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