diff options
author | Daniel Friesel <derf@finalrewind.org> | 2023-03-01 17:59:20 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2023-03-01 17:59:20 +0100 |
commit | 77ac39f3897ddb99952ff63d1ebd2baee27006eb (patch) | |
tree | 0ede34b2f3a7091826c46a85ab1a6d7f4168f8de /lib/Travelynx | |
parent | ae42028a71a21c034a1bbb804d8f1bc599f2dba4 (diff) |
user status: pass token to journey on redirect
Diffstat (limited to 'lib/Travelynx')
-rwxr-xr-x | lib/Travelynx/Controller/Traveling.pm | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm index f1f689b..9f00f9d 100755 --- a/lib/Travelynx/Controller/Traveling.pm +++ b/lib/Travelynx/Controller/Traveling.pm @@ -521,17 +521,21 @@ sub user_status { { for my $candidate ( $self->journeys->get( - uid => $user->{id}, - limit => 20, + uid => $user->{id}, + sched_dep_ts => $ts, + limit => 1, ) ) { - if ( $candidate->{sched_dep_ts} eq $ts ) { - - # TODO pass token + my $token = $self->param('token'); + if ($token) { + $self->redirect_to( + "/p/${name}/j/$candidate->{id}?token=${token}-${ts}"); + } + else { $self->redirect_to("/p/${name}/j/$candidate->{id}"); - return; } + return; } $self->render('not_found'); return; |