我看了很多都糊涂了,我觉得我理解的比以前少了!
我在 Laravel 8 上配置了我的护照:
SELECT t1.field1, t1.field2 - IIF(t3.calcfield IS NULL, 0, t3.calc) As Diff
FROM my_saved_query t3
LEFT JOIN table4 t4
ON t3.fieldid = t4.fieldid
所以我通过以下路线提供服务:'api' => [
'driver' => 'passport',
'provider' => 'users',
],
、login
和 logout
。
registration
而 Route::post('/register', [AuthController::class, 'register']);
Route::post('/login', [AuthController::class, 'login']);
Route::post('/logout', [AuthController::class, 'logout']);
提供了方法并且几乎可以工作!
我的问题是:
AuthController
添加守卫,这将不起作用。那么这是不必要的还是我的逻辑错误?还是如我所写的那样正确?logout
吗?如果是,应该保护路线吗?或者令牌过期后我该怎么办?我尝试添加一个方法:
refresh tokens
但这让我回到了这个错误:
<块引用>BadMethodCallException: Method Illuminate\Auth\RequestGuard::refresh 不存在。在文件中 /home/natty/workspace/sportIndexBackEnd/vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php 在线 103