首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Laravel 5.6 - 用户(正确)未通过身份验证怎么解决?

Laravel 5.6 - 用户(正确)未通过身份验证怎么解决?
EN

Stack Overflow用户
提问于 2018-06-19 07:38:58
回答 1查看 0关注 0票数 0

我查找了几天,但是我的用户在使用auth中间件时从未获得认证。

我们不使用标准的laravel方式,而是使用标准auth中间件来阻止对路由组的访问。

数据是正确的,因为它不提供任何错误消息,但用户本身永远不会被认证。

没有任何特定的代码,但我的登录用户总是定向到未经身份验证的方法。

EN

回答 1

Stack Overflow用户

发布于 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);
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/-100005430

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档