Skip to content

Commit

Permalink
Dynamic Login link
Browse files Browse the repository at this point in the history
  • Loading branch information
mooxbot committed Apr 27, 2024
1 parent a519185 commit 5cb06ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/login-link.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
'App Users' => \App\Models\User::class,
'Moox Users' => \Moox\User\Models\User::class,
],
'redirect_to' => '/moox',
];
4 changes: 3 additions & 1 deletion src/Http/Controllers/LoginLinkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ public function authenticate($userId, $token)
$user = $userModel::findOrFail($userId);
Auth::login($user);

return redirect('/moox')->with('message', 'You have been successfully logged in!');
$redirectTo = config('login-link.redirect_to');

return redirect($redirectTo)->with('message', 'You have been successfully logged in!');
}

private function findUserByEmail($email)
Expand Down

0 comments on commit 5cb06ad

Please sign in to comment.