feat(oauth): access-denied page instead of redirect on gate failure#67
Merged
Conversation
…ailure When a user fails an application's required-group gate, show a clear in-app error page rather than bouncing them back to the client with ?error=access_denied. - ValidateAuthorize runs CheckAccessGate (entity_id from the session) and returns 403 access_denied + app_name, so denial shows on landing — before the consent screen - AuthorizePage renders a dedicated Access denied page for that response, and also catches a 403 access_denied on the approve POST as a safety net (membership can change between landing and approving) instead of redirecting
Match the consent screen's layout: app icon (gradient tile or icon URL), app name, and a 'Back to <app>' action. Backend 403 now also returns app_icon_url so the validate-step denial can render the icon. Extract a shared AppAvatar used by both the consent and denied views.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a user fails an application's required-group access gate, show a clear in-app Access denied page instead of immediately redirecting them back to the client with
?error=access_denied.Screenshot
Backend
ValidateAuthorizenow runsCheckAccessGate(using theentity_idthe SPA already sends) and returns403 {error: access_denied, app_name}when the user doesn't qualify. So the denial is determined on landing, before the consent screen renders.502, consistent with the rest of the flow.Frontend (
AuthorizePage)403 access_deniedvalidate response — the denied user never sees a consent screen.403 access_denied(membership can change between landing and approving) and shows the same page instead of redirecting.Notes
access_denied(the client should know the user declined) — only gate denials show the in-app page.go build/vet/gofmtclean; webtsc/eslint/buildclean.