mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-02 08:06:38 +08:00
微调,暂不可用
This commit is contained in:
parent
4bc7f62c0b
commit
cd68a0135e
@ -29,6 +29,9 @@ export const authOptions: NextAuthOptions = {
|
|||||||
image: profile.avatar_url,
|
image: profile.avatar_url,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
httpOptions: {
|
||||||
|
timeout: 50000,
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
EmailProvider({
|
EmailProvider({
|
||||||
server: {
|
server: {
|
||||||
@ -152,11 +155,12 @@ export const authOptions: NextAuthOptions = {
|
|||||||
// console.log('555555555,', session, token)
|
// console.log('555555555,', session, token)
|
||||||
return session;
|
return session;
|
||||||
},
|
},
|
||||||
// 过滤不存在的用户,目前没用
|
// 过滤不存在的用户
|
||||||
async signIn({ user, account, profile, email, credentials }) {
|
async signIn({ user, account, profile, email, credentials }) {
|
||||||
const existingUser = await existUser(user as User);
|
const existingUser = await existUser(user as User);
|
||||||
console.log('---', user, 'account', account, 'email', email, 'exist', existingUser)
|
console.log('---', user, 'account', account, 'email', email, 'exist', existingUser)
|
||||||
return !!existingUser;
|
// 顺便过滤掉不允许登录的用户
|
||||||
|
return !!existingUser && existingUser.allowToLogin;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -24,6 +24,7 @@ model User {
|
|||||||
password String?
|
password String?
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
|
allowToLogin Boolean @default(true)
|
||||||
accounts Account[]
|
accounts Account[]
|
||||||
sessions Session[]
|
sessions Session[]
|
||||||
// sites Site[]
|
// sites Site[]
|
||||||
|
Loading…
Reference in New Issue
Block a user