mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-01 15:46:39 +08:00
fix logined user issue
This commit is contained in:
parent
ee2e66fc93
commit
c2e385e88d
@ -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;
|
||||
},
|
||||
|
@ -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",
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user