【发布时间】:2019-05-13 09:22:42
【问题描述】:
对于每个请求,我发现会触发 4 个查询来验证用户和令牌。其中一种是根据用户id获取用户(select * from user)。此查询由 Passport/Laravel 触发,但我想要修改此查询以添加一个状态字段检查,以检查是否有任何用户在令牌有效期内变为无效。如果我们只检查 id,那么如果任何用户变为非活动状态(通过更改状态,我们也将无法阻止用户,因为删除用户的令牌对我来说不是一个好的解决方案)。
在 Passport Laravel 的每个请求上触发的查询:
select * from oauth_access_tokens where id = ?
select * from user where id = ? limit 1 ["2"]
select * from oauth_access_tokens where id = ?
select * from oauth_clients where id = ?
那么,谁能告诉我如何在令牌验证时更改护照中的“select * from user where id”查询。
【问题讨论】:
标签: laravel laravel-5 laravel-passport