fix(ui): drop OidcCallback ?local trap on login_required
This commit is contained in:
@@ -20,11 +20,6 @@ export function OidcCallback() {
|
|||||||
const errorParam = params.get('error');
|
const errorParam = params.get('error');
|
||||||
|
|
||||||
if (errorParam) {
|
if (errorParam) {
|
||||||
// prompt=none failed — no session, fall back to login form
|
|
||||||
if (errorParam === 'login_required' || errorParam === 'interaction_required') {
|
|
||||||
window.location.replace(`${config.basePath}login?local`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// consent_required — retry without prompt=none so user can grant scopes
|
// consent_required — retry without prompt=none so user can grant scopes
|
||||||
if (errorParam === 'consent_required' && !sessionStorage.getItem('oidc-consent-retry')) {
|
if (errorParam === 'consent_required' && !sessionStorage.getItem('oidc-consent-retry')) {
|
||||||
sessionStorage.setItem('oidc-consent-retry', '1');
|
sessionStorage.setItem('oidc-consent-retry', '1');
|
||||||
@@ -43,7 +38,7 @@ export function OidcCallback() {
|
|||||||
window.location.href = `${data.authorizationEndpoint}?${p}`;
|
window.location.href = `${data.authorizationEndpoint}?${p}`;
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
window.location.replace(`${config.basePath}login?local`);
|
useAuthStore.setState({ error: 'OIDC consent retry failed.', loading: false });
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -77,7 +72,7 @@ export function OidcCallback() {
|
|||||||
{error && (
|
{error && (
|
||||||
<>
|
<>
|
||||||
<Alert variant="error">{error}</Alert>
|
<Alert variant="error">{error}</Alert>
|
||||||
<Button variant="secondary" onClick={() => navigate('/login?local')} className={styles.backButton}>
|
<Button variant="secondary" onClick={() => navigate('/login')} className={styles.backButton}>
|
||||||
Back to Login
|
Back to Login
|
||||||
</Button>
|
</Button>
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user