mirror of https://github.com/boxyhq/jackson.git
Generalise error display (#978)
This commit is contained in:
parent
94d3c5fd9b
commit
54bd0467de
|
@ -61,7 +61,7 @@
|
|||
"server_error": "server error",
|
||||
"sign_out": "Sign out",
|
||||
"saml": "SAML",
|
||||
"saml_error": "SAML error",
|
||||
"sso_error": "SSO error",
|
||||
"scim_endpoint": "SCIM Endpoint",
|
||||
"scim_token": "SCIM Token",
|
||||
"select_type": "Select Type",
|
||||
|
|
|
@ -73,8 +73,11 @@ export class SAMLHandler {
|
|||
});
|
||||
}
|
||||
|
||||
const noSSOConnectionErrMessage =
|
||||
authFlow === 'oauth' ? 'No SSO connection found.' : 'No SAML connection found.';
|
||||
|
||||
if (!connections || connections.length === 0) {
|
||||
throw new JacksonError('No SAML connection found.', 404);
|
||||
throw new JacksonError(noSSOConnectionErrMessage, 404);
|
||||
}
|
||||
|
||||
// If an IdP is specified, find the connection for that IdP
|
||||
|
@ -82,7 +85,7 @@ export class SAMLHandler {
|
|||
const connection = connections.find((c) => c.clientID === idp_hint);
|
||||
|
||||
if (!connection) {
|
||||
throw new JacksonError('No SAML connection found.', 404);
|
||||
throw new JacksonError(noSSOConnectionErrMessage, 404);
|
||||
}
|
||||
|
||||
return { connection };
|
||||
|
|
|
@ -47,7 +47,9 @@ export default function Error() {
|
|||
<p className='mb-4 text-3xl font-bold tracking-tight text-gray-900 dark:text-white md:text-4xl'>
|
||||
{statusText}
|
||||
</p>
|
||||
<p className='mb-4 text-lg font-light'>{t('saml_error')}: {message}</p>
|
||||
<p className='mb-4 text-lg font-light'>
|
||||
{t('sso_error')}: {message}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
Loading…
Reference in New Issue