Context
PR #2955 (fix for #1273) maps all OAuth provider errors — including access_denied — to a single friendly message:
"Sign in failed. Please try again, or use a different sign-in method."
This is correct for internal errors (invalid state, token failure, etc.), but slightly misleading for access_denied: that code means the user or provider explicitly denied or cancelled the authorisation. Telling them to "try again" may prompt a loop where they keep cancelling and being asked to try again.
Proposal
Add a dedicated translation key — e.g. auth.login.errors.oauthAccessDenied — and route error=access_denied redirects to that key, with wording such as:
"Sign in was cancelled or access was denied. If this was a mistake, please try again."
This keeps the generic oauthSignin message for infrastructure failures (token errors, bad state, etc.) while giving a more honest, actionable message for explicit user/provider denials.
Implementation notes
- In
server.py oauth_callback and oauth_azure_hf_callback, check if error == "access_denied" before the generic fallback.
- Add
oauthAccessDenied to all 23 locale files in backend/chainlit/translations/.
- Update
spec.cy.ts to cover the new key for the access_denied test case.
References
Context
PR #2955 (fix for #1273) maps all OAuth provider errors — including
access_denied— to a single friendly message:This is correct for internal errors (invalid state, token failure, etc.), but slightly misleading for
access_denied: that code means the user or provider explicitly denied or cancelled the authorisation. Telling them to "try again" may prompt a loop where they keep cancelling and being asked to try again.Proposal
Add a dedicated translation key — e.g.
auth.login.errors.oauthAccessDenied— and routeerror=access_deniedredirects to that key, with wording such as:This keeps the generic
oauthSigninmessage for infrastructure failures (token errors, bad state, etc.) while giving a more honest, actionable message for explicit user/provider denials.Implementation notes
server.pyoauth_callbackandoauth_azure_hf_callback, checkif error == "access_denied"before the generic fallback.oauthAccessDeniedto all 23 locale files inbackend/chainlit/translations/.spec.cy.tsto cover the new key for theaccess_deniedtest case.References