find all in files
protected function sendLoginResponse(Request $request)
you can see
protected function sendLoginResponse(Request $request)
{
$request->session()->regenerate();
$this->clearLoginAttempts($request);
if ($response = $this->authenticated($request, $this->guard()->user())) {
return $response;
}
return $request->wantsJson()
? new JsonResponse([], 204)
: redirect()->intended($this->redirectPath());
}
change to it
protected function sendLoginResponse(Request $request)
{
$request->session()->regenerate();
$this->clearLoginAttempts($request);
if ($response = $this->authenticated($request, $this->guard()->user())) {
return $response;
}
return $request->wantsJson()
//? new JsonResponse([], 204)
? response()->json(['logged_in'=>true])
: redirect()->intended($this->redirectPath());
}
logout response
public function logout(Request $request)
{
$this->guard()->logout();
$request->session()->invalidate();
$request->session()->regenerateToken();
if ($response = $this->loggedOut($request)) {
return $response;
}
return $request->wantsJson()
//? new JsonResponse([], 204)
? response()->json( \Auth::user() )
: redirect('/');
}
沒有留言:
發佈留言