fix: NO_LIMIT_SEND_ROLE no access token (#400)

This commit is contained in:
Dream Hunter
2024-08-13 01:38:20 +08:00
committed by GitHub
parent 7e5d142924
commit 797b8bb019
2 changed files with 3 additions and 3 deletions

View File

@@ -3,7 +3,7 @@
## main(v0.7.2)
- fix: worker 增加 `NO_LIMIT_SEND_ROLE` 配置, 有时加载失败的问题
- fix: worker 增加 `NO_LIMIT_SEND_ROLE` 配置, 加载失败的问题
## v0.7.1

View File

@@ -31,10 +31,10 @@ export default {
&&
c.env.ADMIN_USER_ROLE === user_role?.role
);
const access_token = is_admin ? await Jwt.sign({
const access_token = user_role?.role ? await Jwt.sign({
user_email: user.user_email,
user_id: user.user_id,
user_role: user_role?.role,
user_role: user_role.role,
iat: Math.floor(Date.now() / 1000),
// 1 hour
exp: Math.floor(Date.now() / 1000) + 3600,