diff --git a/src/routes/(public)/oauth2/consent/+page.svelte b/src/routes/(public)/oauth2/consent/+page.svelte index c5c0dc4d1..09c308063 100644 --- a/src/routes/(public)/oauth2/consent/+page.svelte +++ b/src/routes/(public)/oauth2/consent/+page.svelte @@ -1,6 +1,6 @@ @@ -286,7 +292,7 @@ {error} - diff --git a/src/routes/(public)/oauth2/errors.ts b/src/routes/(public)/oauth2/errors.ts new file mode 100644 index 000000000..c91075e57 --- /dev/null +++ b/src/routes/(public)/oauth2/errors.ts @@ -0,0 +1,18 @@ +/** + * Exception `type` values returned by the OAuth2 endpoints. The SDK does not + * export these, so they are mirrored here. + */ +export const OAuth2ErrorType = { + /** + * Covers every dead request_uri handle case (expired, consumed, malformed). + */ + INVALID_REQUEST: 'oauth2_invalid_request' +} as const; + +export const OAuth2ErrorMessage = { + AUTHORIZE_FAILED: 'Could not start authorization.', + GRANT_INVALID: 'This authorization request is invalid or has expired.', + HANDLE_EXPIRED: + 'This sign-in request has expired. Return to the application and try connecting again.', + MISSING_REQUEST: 'Missing authorization request. Open this page from an application sign-in.' +} as const;