feat(routes): add access-denied route and update authentication flow
quality / changes (push) Successful in 5s
quality / api (push) Skipped
quality / commitlint (push) Skipped
quality / docker-check (push) Skipped
CD / update-wiki (push) Successful in 5s
quality / web (push) Successful in 57s
CD / quality (push) Successful in 1m9s
CD / publish (push) Successful in 1m39s
quality / changes (push) Successful in 5s
quality / api (push) Skipped
quality / commitlint (push) Skipped
quality / docker-check (push) Skipped
CD / update-wiki (push) Successful in 5s
quality / web (push) Successful in 57s
CD / quality (push) Successful in 1m9s
CD / publish (push) Successful in 1m39s
- Introduced a new Access Denied route to handle unauthorized access. - Updated routing logic to redirect to the Access Denied page when necessary. - Enhanced authentication checks to prevent infinite redirect loops and improve user experience. - Adjusted API client to handle JWT rejection scenarios more gracefully.
This commit is contained in:
@@ -30,6 +30,13 @@ async function handoffOnUnauthorized(): Promise<void> {
|
||||
redirectToPortalLogin(`${window.location.origin}/auth/callback`)
|
||||
return
|
||||
}
|
||||
// Cooldown / recent handoff — stop SSO storm (wrong JWT secret / issuer).
|
||||
if (cfg.required || isAuthEnabled()) {
|
||||
window.location.assign(
|
||||
`${window.location.origin}/auth/callback?error=jwt_rejected`,
|
||||
)
|
||||
return
|
||||
}
|
||||
if (!cfg.required && !isAuthEnabled()) {
|
||||
window.location.href = '/login'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user