fix logined user issue

This commit is contained in:
sijinhui 2024-04-29 13:01:20 +08:00
parent ee2e66fc93
commit c2e385e88d
2 changed files with 8 additions and 1 deletions

View File

@ -141,6 +141,13 @@ export const authOptions: NextAuthOptions = {
// console.log('=============', token, user,)
if (user) {
token.user = user;
} else {
const updateUser = await prisma.user.findUnique({ where: { id: token.sub }});
// console.log('========', updateUser)
if (!updateUser || !updateUser.allowToLogin) {
throw new Error('无法刷新令牌,用户状态不正确');
}
token.user = updateUser;
}
return token;
},

View File

@ -5,7 +5,7 @@ export const DENY_LIST: string[] = [
"zhangsan",
]
export const ADMIN_LIST: string[] = [
"司金辉", "sijinhui", "sijinhui@qq.com",
"sijinhui", "sijinhui@qq.com",
"yuchuan", "于川",
"jujujujuju",
]