0
我在Laravel中创建了一个后端,并在离子中创建了一个应用程序。我在前端使用satellizer,并在laravel端使用this package进行JWT身份验证。由于我需要在用户注销之前拥有令牌,所以我需要一种方式来以某种方式刷新令牌。我不知道如何做到这一点,让所有路由请求auth令牌并发送401响应(如果不存在),然后执行令牌刷新或刷新前端定时器的令牌以及如何实际执行?角度 - 刷新jwt令牌
这是我的路线文件:
Route::group(['jwt.auth', ['except' => ['authenticate']], 'prefix' => 'api', 'namespace' => 'Api'], function() {
Route::post('authenticate', '[email protected]');
Route::get('user', '[email protected]');
Route::get('comment', '[email protected]');
Route::get('articles/latest', '[email protected]');
Route::get('articles/by-score', '[email protected]');
Route::get('article/{id}', '[email protected]');
Route::get('comments', '[email protected]');
Route::get('comments/{id}', '[email protected]');
Route::post('comments/create', '[email protected]');
Route::put('comments/update', '[email protected]');
Route::delete('comments/delete', '[email protected]');
Route::post('article/upvote', '[email protected]');
Route::delete('article/upvote/delete', '[email protected]');
Route::post('article/challenge/vote', '[email protected]');
Route::delete('article/challenge/vote/delete', '[email protected]');
});