fix: Autologin forces logout
This commit is contained in:
parent
52f59afe63
commit
4d3083886e
2 changed files with 10 additions and 2 deletions
|
@ -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
Loading…
Reference in a new issue