Merge pull request #662 from cuneytsenturk/master

Redirect to current URL if session timeout
This commit is contained in:
Cüneyt Şentürk 2018-12-03 13:50:41 +03:00 committed by GitHub
commit c79ad5a99e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -56,6 +56,9 @@ class Handler extends ExceptionHandler
*/
protected function unauthenticated($request, AuthenticationException $exception)
{
// Store the current uri in the session
session(['url.intended' => $request->url()]);
if ($request->expectsJson()) {
return response()->json(['error' => 'Unauthenticated.'], 401);
}

View File

@ -84,7 +84,7 @@ class Login extends Controller
return redirect('wizard');
}
return redirect('/');
return redirect()->intended('/');
}
public function destroy()