minor change
This commit is contained in:
parent
495509c888
commit
078e5ba95f
|
@ -1179,14 +1179,14 @@ export default async function auth(req: NextApiRequest, res: NextApiResponse) {
|
|||
},
|
||||
callbacks: {
|
||||
async signIn({ user, account, profile, email, credentials }) {
|
||||
if (account?.provider !== "credentials" && newSsoUsersDisabled) {
|
||||
if (account?.provider !== "credentials") {
|
||||
// registration via SSO can be separately disabled
|
||||
const existingUser = await prisma.account.findFirst({
|
||||
where: {
|
||||
providerAccountId: account?.providerAccountId,
|
||||
},
|
||||
});
|
||||
if (!existingUser) {
|
||||
if (!existingUser && newSsoUsersDisabled) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Ŝarĝante…
Reference in New Issue