I access to /admin and i get the redirect to /admin/login (that's normal, cause i'm not logged) but i can't see my view /admin/login.
I get this error:
Trying to get property of non-object
in VerifyCsrfToken.php (line 156)
If need code of some controller or something, write it please.
Thanks
Lines error:
$response->headers->setCookie(
new Cookie(
'XSRF-TOKEN', $request->session()->token(), Carbon::now()-
>getTimestamp() + 60 * $config['lifetime'],
$config['path'], $config['domain'], $config['secure'],
false
)
);
Handler function on RedirectIfAuthenticated.php
public function handle($request, Closure $next, $guard = null)
{
switch($guard){
case 'admin':
if (Auth::guard($guard)->check()) {
return redirect()->route('admin.dashboard');
}
break;
default:
if (Auth::guard($guard)->check()) {
return redirect('/');
}
break;
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…