🧑💻 Improve sign up error message
This commit is contained in:
@ -94,11 +94,20 @@ export const SignInForm = ({
|
||||
status: 'info',
|
||||
description: t('auth.signinErrorToast.tooManyRequests'),
|
||||
})
|
||||
else
|
||||
else if (response.error.includes('sign-up-disabled'))
|
||||
showToast({
|
||||
title: t('auth.signinErrorToast.title'),
|
||||
description: t('auth.signinErrorToast.description'),
|
||||
})
|
||||
else
|
||||
showToast({
|
||||
status: 'info',
|
||||
description: t('errorMessage'),
|
||||
details: {
|
||||
content: 'Check server logs to see relevent error message.',
|
||||
lang: 'json',
|
||||
},
|
||||
})
|
||||
} else {
|
||||
setIsMagicLinkSent(true)
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ export const getAuthOptions = ({
|
||||
const { invitations, workspaceInvitations } =
|
||||
await getNewUserInvitations(prisma, user.email)
|
||||
if (invitations.length === 0 && workspaceInvitations.length === 0)
|
||||
return false
|
||||
throw new Error('sign-up-disabled')
|
||||
}
|
||||
const requiredGroups = getRequiredGroups(account.provider)
|
||||
if (requiredGroups.length > 0) {
|
||||
|
Reference in New Issue
Block a user