- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我跑 $user->currentAccessToken()->delete();
token 过期,Auth::check()
变成 false
,这是预期的。
然而,当我去personal_access_tokens
表, token 还在那里。没有软删除字段。 Sanctum 现在 token 过期了怎么办?
最佳答案
可以在config/sanctum.php数组中设置节点过期时间
/*
|--------------------------------------------------------------------------
| Expiration Minutes
|--------------------------------------------------------------------------
|
| This value controls the number of minutes until an issued token will be
| considered expired. If this value is null, personal access tokens do
| not expire. This won't tweak the lifetime of first-party sessions.
|
*/
'expiration' => 60 * 24 * 7,
关于laravel - Laravel sanctum 如何使 token 过期?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64117057/
我使用 Laravel Sanctum 设置了 SPA 身份验证,它工作正常。我用一个用户登录成功。在 Chrome Devtools 中,Application > Storage > Cookie
我有一个具有以下设置的应用程序: Laravel 主机:appname.local:8000 环境变量: SESSION_DRIVER=数据库 SESSION_LIFETIME=480 SESSION
我想知道检查用户是否仍在客户端登录的最佳做法是什么。 假设用户登录。如果成功,它将保存在状态中,如下所示: axios.post('/login').then(() => { this.state
我的 laravel 应用程序中有多个 guard : 代码 config/auth.php : 'defaults' => [ 'guard' => 'user', 'passwor
我在我的 Vue 项目中使用 laravel sanctum SPA 身份验证。一切运行良好,但即使在注销后 Auth::logout() 我仍然能够从中间件内的 api 路由获取数据 Route::
关闭。这个问题是opinion-based .它目前不接受答案。 想改善这个问题吗?更新问题,以便可以通过 editing this post 用事实和引文回答问题. 去年关闭。 Improve th
我在使用子域和 laravel sanctum 时遇到问题。在子域上,我未获得授权。它在本地工作得很好。 我已将域添加到 sanctum domain/.env。我还根据关于子域的 laravel 文
我是按照Laravel官方文档一步步来的。 当我向 {{host}}/api/login 发送请求时,我可以收到包含 token 的响应。一切都是正确的。 但是当我尝试向 {{host}}/api/u
我正在尝试将 Laravel Sanctum 用于我的 SPA。有一些来自 web.php 路由的基本主页,但其他 axios与 SPA 的 API 交互在 api.php 路由中,由 auth:sa
我正在用 laravel sanctum 进行测试,但这里有一些问题.. 我正在创建管理员守卫。 当我将中间件更改为 auth:sanctum_admin .. 它应该只能由管理员访问,但在这里我可以
我正在使用 laravel sanctum 并将中间件添加到我的 route : Route::group(['middleware' => 'auth:sanctum'], function ()
我正在尝试测试经过身份验证的 API 路由,该路由只有经过身份验证的用户才能发布到特定路由。 查看 Laravel Sanctum 文档,我可以使用下面的代码来创建和验证用户: Sanctum::ac
我在让 Laravel Sanctum 授权两个独立数据库中的两个表时遇到了一些问题。 我正在使用 Laravel Sanctum token 进行授权。我有两个表来授权用户(用户和联系人)我设置了两
我之前使用过 Laravel 的内置 api token 身份验证,但我想为不同的客户端提供多个 api token ,并且在 Laravel 7.x 中,我正在尝试迁移到 Laravel Sanct
我正在尝试在我的 laravel vue 应用程序中获取当前用户。每当我尝试获取它时,我都会收到此错误: Symfony\Component\Routing\Exception\RouteNotFou
我正在使用 Laravel sanctum 来验证我的 API,但我没有使用默认的 laravel 用户模型,我已经构建了一个模型来在另一个名为 Customer 的表中分隔我的 App 客户。为此,
我是 laravel 的新手,正在尝试使用 sanctum 为登录构建一个 api。 我遵循了文档和一些教程,但我遇到了一个错误,即即使使用 HasApiToken,我的用户类也无法访问 token
我怎样才能将 laravel sanctum csrf cookie 路由更改为 /api/sanctum/csrf-cookie ? 我尝试将其添加到 api.php 路由中: use Larave
当我跑 $user->currentAccessToken()->delete(); token 过期,Auth::check()变成 false ,这是预期的。 然而,当我去personal_acc
Laravel auth、Passport 和 Sanctum 之间有什么区别以及它们何时使用? 最佳答案 Passport 在几分钟内为您的 Laravel 应用程序提供了完整的 OAuth2 服务
我是一名优秀的程序员,十分优秀!