Auth::logout() 在本地工作,但不在服务器中工作,用于 Lumen 中的 JWT 身份验证

问题描述 投票:0回答:0

在我的 Laravel Lumen(版本 8)应用程序中,当我尝试使用 Auth::logout() 注销时,出现 500 服务器错误。我无法捕获为什么会出现此问题的日志。

我的注销()定义如下:

public function logout()
{
     Auth::logout();

     return response()->json(['message' => 'Successfully logged out']);
}  

I have found 500 error. The actual error is not showing.

我已尝试修复所有可能的更改。但对我没有任何帮助。 请帮我解决这个问题。提前致谢。

注意:- 1. 我试过使用 auth()->logout()。但没有用。 2.我也试过session flush或destory,还是不行。 3. 也试过 Auth::invalidate,没用。

在上述任何更改中,都存在 500 服务器错误,甚至令牌还没有过期。

php laravel jwt lumen server-error
© www.soinside.com 2019 - 2024. All rights reserved.