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

- 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:
Denozordec
2026-09-04 14:23:23 +07:00
parent 64e6df8703
commit 9cc6c8d958
9 changed files with 139 additions and 14 deletions
+7
View File
@@ -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'
}