【问题标题】:Laravel Logout functionality not working?Laravel 注销功能不起作用?
【发布时间】:2019-04-24 05:31:02
【问题描述】:

在 laravel 5.7 中,当我要单击注销按钮时,注销功能不起作用,它向我显示此错误 /var/www/html/orderManager/vendor/auth0/login/src/Auth0/Login/Auth0Service.php

$this->authApi = new Authentication($this->auth0Config['domain'], 
$this->auth0Config['client_id']);

“未定义索引:域”

web.php

Route::get('logout', 'HomeController@logout');

HomeController.php

public function logout() {
        Auth::logout();
        Session::flush();
        return redirect('/login');
    }

【问题讨论】:

  • 你在config/laravel-auth0.php中设置了domain吗?
  • 你有没有尝试阅读这条消息?

标签: php laravel-5.7


【解决方案1】:

我删除了这个

"auth0/login": "~5.0" 

来自 composer.json 和 update composer 及其工作..

【讨论】:

    【解决方案2】:

    如果您自己进行自定义注销,您可以将注销方法更改为如下所示

    public function logout() {
         auth()->logout();
         return redirect('/login');
    }
    

    然后删除 auth0 包并尝试运行 composer update

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-06-25
      • 2018-03-12
      • 1970-01-01
      • 2017-01-07
      • 2013-02-15
      • 1970-01-01
      • 2017-01-26
      相关资源
      最近更新 更多