fix: Autologin forces logout

This commit is contained in:
Attila Kerekes 2022-12-15 22:21:16 +01:00
parent 52f59afe63
commit 4d3083886e
2 changed files with 10 additions and 2 deletions

View file

@ -46,7 +46,7 @@ class LoginController extends Controller
public function __construct()
{
Session::put('backUrl', URL::previous());
$this->middleware('guest')->except('logout');
$this->middleware('guest')->except(['logout','autologin']);
}
/**
@ -115,8 +115,16 @@ class LoginController extends Controller
*/
public function autologin($uuid): RedirectResponse
{
Auth::logout();
$user = User::where('autologin', $uuid)->first();
if (!$user) {
return redirect()->route('dash');
}
Auth::login($user, true);
session(['current_user' => $user]);
return redirect()->route('dash');

File diff suppressed because one or more lines are too long