Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

设置了Token有效期后登录判断有问题 #153

Closed
halo123450 opened this issue Sep 28, 2024 · 1 comment
Closed

设置了Token有效期后登录判断有问题 #153

halo123450 opened this issue Sep 28, 2024 · 1 comment

Comments

@halo123450
Copy link

描述问题:

最新版本新增了判断Token使用有效期的逻辑,但是登录成功后last_used_at值为空,导致登录后Token无效

截图或视频:

image
image
image

如何复现(请务必完整填写下面内容):

  1. owl-admin 版本是什么?
    v4.0.1

  2. PHP & Laravel 版本是什么?

php8.2 & laravel: 11.25.0

  1. 运行环境

Linux + Centos7.9

  1. 操作步骤
    .env 设置

token 有效期 (分钟), 为空则不会过期

ADMIN_TOKEN_EXPIRATION=1440
请求登录接口
/admin-api/login
{
"username": "xxxxx",
"password": "xxxxx",
"remember": true,
"captcha": "4GNZ",
"sys_captcha": "captcha:66f82631cc0ee"
}

获取Token后Token为无效值因为执行的SQL为
select * from personal_access_tokens where last_used_at >= '2024-09-27 23:54:35' and personal_access_tokens.id = 76 limit 1
personal_access_tokens表中的last_used_at 字段值 IS NULL

@slowlyo
Copy link
Owner

slowlyo commented Sep 29, 2024

v4.0.2 已修复

@slowlyo slowlyo closed this as completed Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants