How do I get a new token in the controller after laravel refreshes the token?

jwt the token I refreshed in the middleware will be blacklisted by jwt after the old token is refreshed. At this time, if the controller uses JWTAuth::getToken () to get token, it will prompt The token has been blacklisted what to do? How do I get this new token in the controller"s index method?

Route::group(["namespace" => "Api"], function(){
    Route::middleware(["refresh"])->group(function () {
        Route::post("index", "AuthController@index");
    });
});

Middleware

$old_token = JWTAuth::getToken();
$token = JWTAuth::refresh($old_token);

AuthController

public function index() {
        $token = JWTAuth::getToken();
        $user = JWTAuth::parseToken()->authenticate();
        dd($user);
}
May.27,2022

$old_token = JWTAuth::getToken();
$token = JWTAuth::refresh($old_token);

JWTAuth::setToken($token)

however, it is recommended that you configure jwt to set an available time for the old Token (maybe 30 seconds or 1 minute)
because sometimes concurrent requests occur and the user sends two requests at the same time, but its token has expired, and the first request is accepted and the token is refreshed, but the second request issued at the same time will fail verification

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3ac40-2c237.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3ac40-2c237.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?