diff --git a/app/scenes/Login/Notices.tsx b/app/scenes/Login/Notices.tsx index 3d5aaee1f..dc51f8ae8 100644 --- a/app/scenes/Login/Notices.tsx +++ b/app/scenes/Login/Notices.tsx @@ -7,7 +7,6 @@ import useQuery from "~/hooks/useQuery"; export default function Notices() { const query = useQuery(); const notice = query.get("notice"); - const description = query.get("description"); if (!notice) { return null; @@ -15,12 +14,18 @@ export default function Notices() { return ( }> + {notice === "domain-not-allowed" && ( + + The domain associated with your email address has not been allowed for + this workspace. + + )} {notice === "domain-required" && ( - Unable to sign-in. Please navigate to your team's custom URL, then try - to sign-in again. + Unable to sign-in. Please navigate to your workspace's custom URL, + then try to sign-in again.
- If you were invited to a team, you will find a link to it in the + If you were invited to a workspace, you will find a link to it in the invite email.
)} @@ -33,7 +38,7 @@ export default function Notices() { )} {notice === "maximum-teams" && ( - The team you authenticated with is not authorized on this + The workspace you authenticated with is not authorized on this installation. Try another? )} @@ -54,34 +59,28 @@ export default function Notices() { try again in a few minutes. )} - {(notice === "auth-error" || notice === "state-mismatch") && - (description ? ( - <>{description} - ) : ( - - Authentication failed – we were unable to sign you in at this time. - Please try again. - - ))} - {notice === "invalid-authentication" && - (description ? ( - <>{description} - ) : ( - - Authentication failed – you do not have permission to access this - team. - - ))} + {(notice === "auth-error" || notice === "state-mismatch") && ( + + Authentication failed – we were unable to sign you in at this time. + Please try again. + + )} + {notice === "invalid-authentication" && ( + + Authentication failed – you do not have permission to access this + workspace. + + )} {notice === "expired-token" && ( Sorry, it looks like that sign-in link is no longer valid, please try requesting another. )} - {notice === "suspended" && ( + {(notice === "suspended" || notice === "user-suspended") && ( Your account has been suspended. To re-activate your account, please - contact a team admin. + contact a workspace admin. )} {notice === "authentication-provider-disabled" && ( @@ -92,16 +91,16 @@ export default function Notices() { )} {notice === "invite-required" && ( - The team you are trying to join requires an invite before you can + The workspace you are trying to join requires an invite before you can create an account.
- Please request an invite from your team admin and try again. + Please request an invite from your workspace admin and try again.
)} {notice === "domain-not-allowed" && ( Sorry, your domain is not allowed. Please try again with an allowed - team domain. + workspace domain. )}
diff --git a/server/commands/accountProvisioner.ts b/server/commands/accountProvisioner.ts index e2ee410a4..91b735408 100644 --- a/server/commands/accountProvisioner.ts +++ b/server/commands/accountProvisioner.ts @@ -111,6 +111,10 @@ async function accountProvisioner({ } } + if (err.id) { + throw err; + } + if (!result) { throw InvalidAuthenticationError(err.message); } diff --git a/shared/i18n/locales/en_US/translation.json b/shared/i18n/locales/en_US/translation.json index 178037d16..b5e6b8be4 100644 --- a/shared/i18n/locales/en_US/translation.json +++ b/shared/i18n/locales/en_US/translation.json @@ -628,19 +628,20 @@ "You signed in with {{ authProviderName }} last time.": "You signed in with {{ authProviderName }} last time.", "Or": "Or", "Already have an account? Go to <1>login.": "Already have an account? Go to <1>login.", - "Unable to sign-in. Please navigate to your team's custom URL, then try to sign-in again.<1>If you were invited to a team, you will find a link to it in the invite email.": "Unable to sign-in. Please navigate to your team's custom URL, then try to sign-in again.<1>If you were invited to a team, you will find a link to it in the invite email.", + "The domain associated with your email address has not been allowed for this workspace.": "The domain associated with your email address has not been allowed for this workspace.", + "Unable to sign-in. Please navigate to your workspace's custom URL, then try to sign-in again.<1>If you were invited to a workspace, you will find a link to it in the invite email.": "Unable to sign-in. Please navigate to your workspace's custom URL, then try to sign-in again.<1>If you were invited to a workspace, you will find a link to it in the invite email.", "Sorry, a new account cannot be created with a personal Gmail address.<1>Please use a Google Workspaces account instead.": "Sorry, a new account cannot be created with a personal Gmail address.<1>Please use a Google Workspaces account instead.", - "The team you authenticated with is not authorized on this installation. Try another?": "The team you authenticated with is not authorized on this installation. Try another?", + "The workspace you authenticated with is not authorized on this installation. Try another?": "The workspace you authenticated with is not authorized on this installation. Try another?", "We could not read the user info supplied by your identity provider.": "We could not read the user info supplied by your identity provider.", "Your account uses email sign-in, please sign-in with email to continue.": "Your account uses email sign-in, please sign-in with email to continue.", "An email sign-in link was recently sent, please check your inbox or try again in a few minutes.": "An email sign-in link was recently sent, please check your inbox or try again in a few minutes.", "Authentication failed – we were unable to sign you in at this time. Please try again.": "Authentication failed – we were unable to sign you in at this time. Please try again.", - "Authentication failed – you do not have permission to access this team.": "Authentication failed – you do not have permission to access this team.", + "Authentication failed – you do not have permission to access this workspace.": "Authentication failed – you do not have permission to access this workspace.", "Sorry, it looks like that sign-in link is no longer valid, please try requesting another.": "Sorry, it looks like that sign-in link is no longer valid, please try requesting another.", - "Your account has been suspended. To re-activate your account, please contact a team admin.": "Your account has been suspended. To re-activate your account, please contact a team admin.", + "Your account has been suspended. To re-activate your account, please contact a workspace admin.": "Your account has been suspended. To re-activate your account, please contact a workspace admin.", "Authentication failed – this login method was disabled by a team admin.": "Authentication failed – this login method was disabled by a team admin.", - "The team you are trying to join requires an invite before you can create an account.<1>Please request an invite from your team admin and try again.": "The team you are trying to join requires an invite before you can create an account.<1>Please request an invite from your team admin and try again.", - "Sorry, your domain is not allowed. Please try again with an allowed team domain.": "Sorry, your domain is not allowed. Please try again with an allowed team domain.", + "The workspace you are trying to join requires an invite before you can create an account.<1>Please request an invite from your workspace admin and try again.": "The workspace you are trying to join requires an invite before you can create an account.<1>Please request an invite from your workspace admin and try again.", + "Sorry, your domain is not allowed. Please try again with an allowed workspace domain.": "Sorry, your domain is not allowed. Please try again with an allowed workspace domain.", "Any collection": "Any collection", "Any time": "Any time", "Past day": "Past day",