Merge pull request #1073 from linuxserver/fix/395

fix: Autologin forces logout
This commit is contained in:
KodeStar 2022-12-15 23:38:36 +00:00 committed by GitHub
commit 0d9850c1c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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