我查找了几天,但是我的用户在使用auth中间件时从未获得认证。
我们不使用标准的laravel方式,而是使用标准auth中间件来阻止对路由组的访问。
数据是正确的,因为它不提供任何错误消息,但用户本身永远不会被认证。
没有任何特定的代码,但我的登录用户总是定向到未经身份验证的方法。
发布于 2018-06-19 17:23:08
调试auth中间件:
/**
* Determine if the user is logged in to any of the given guards.
*
* @param array $guards
* @return void
*
* @throws \Illuminate\Auth\AuthenticationException
*/
protected function authenticate(array $guards)
{
if (empty($guards)) {
return $this->auth->authenticate();
}
foreach ($guards as $guard) {
if ($this->auth->guard($guard)->check()) {
return $this->auth->shouldUse($guard);
}
}
throw new AuthenticationException('Unauthenticated.', $guards);
}
https://stackoverflow.com/questions/-100005430
复制相似问题