redirect to intended url
This commit is contained in:
parent
2ee2376006
commit
7570918ff8
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class Login extends Controller
|
|||
return redirect($path);
|
||||
}
|
||||
|
||||
return redirect('/');
|
||||
return redirect()->intended('/');
|
||||
}
|
||||
|
||||
public function destroy()
|
||||
|
|
|
|||
Loading…
Reference in New Issue