国产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
675

我嘗試透過教學(xué)使用 php-open-source-saver/jwt-auth https://blog.logrocket.com/implementing-jwt-authentication-laravel-9/

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

Auth::logout();

當(dāng)我登出並嘗試呼叫我的測試方法時,它使用舊令牌。

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

全部回覆(1)
P粉638343995

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

logout()

登出使用者 - 這將使目前令牌無效並取消設(shè)定經(jīng)過身份驗證的使用者。

auth()->logout();

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