国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Laravel 9 JWT 注銷問題 php-open-source-saver/jwt-auth
P粉809110129
P粉809110129 2023-12-12 08:38:04
0
1
686

我嘗試通過教程使用 php-open-source-saver/jwt-auth https://blog.logrocket.com/implementing-jwt-authentication-laravel-9/

它工作正常,但我在注銷時遇到一些問題。

Auth::logout();

當(dāng)我注銷并嘗試調(diào)用我的測試方法時,它使用舊令牌。

class SubjectController extends Controller
{
    public function __construct()
    {
        $this->middleware('auth:api');
    }

    public function show($id)
    {
        $subject = Subject::find($id);

        return response(json_encode($subject))
            ->header('Content-Type','application/json');
    }
}


P粉809110129
P粉809110129

全部回復(fù)(1)
P粉638343995

檢查文檔:https://laravel-jwt-auth .readthedocs.io/en/latest/auth-guard/

logout()

注銷用戶 - 這將使當(dāng)前令牌無效并取消設(shè)置經(jīng)過身份驗證的用戶。

auth()->logout();

// Pass true to force the token to be blacklisted "forever"
auth()->logout(true);
最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板