Skip to content

Commit

Permalink
fixup! When loading "loginAfterlinkSent" and user LoggedIn, try redir…
Browse files Browse the repository at this point in the history
…ect to dashboard.
  • Loading branch information
tomtomklima authored and Lung committed Jan 15, 2025
1 parent 5c82757 commit ce2f8dd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 1 addition & 0 deletions src/Application/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public function addRoutesInto(App $app): App
->setName('sendLoginEmail');

$app->get('/loginAfterLinkSent', UserController::class . '::showAfterLinkSent')
->add(NonLoggedOnlyMiddleware::class)
->setName('loginAfterLinkSent');

$app->get('/tryLogin/{token}', UserController::class . '::tryLoginWithToken')
Expand Down
3 changes: 0 additions & 3 deletions src/User/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ public function sendLoginEmail(Request $request, Response $response): Response

public function showAfterLinkSent(Request $request, Response $response): Response
{
if ($request->getAttribute('user') !== null) {
return $this->redirect($request, $response, 'getDashboard');
}
return $this->view->render($response, 'kissj/login-link-sent.twig');
}

Expand Down

0 comments on commit ce2f8dd

Please sign in to comment.