fix(ui): use instant window.location.replace and hold loading state during auth redirect
This commit is contained in:
parent
54cdf0c442
commit
0a46e2bdfc
@ -159,7 +159,7 @@ export const AuthenticatedLayout = ({
|
||||
</style>
|
||||
<script src="https://unpkg.com/@simplewebauthn/browser/dist/bundle/index.umd.min.js">
|
||||
</script>
|
||||
<script src="/public/auth-client.js?v=3"></script>
|
||||
<script src="/public/auth-client.js?v=4"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header class="header">
|
||||
|
||||
@ -95,7 +95,7 @@ export const LoginPage = () => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/public/auth-client.js?v=3"></script>
|
||||
<script src="/public/auth-client.js?v=4"></script>
|
||||
<script
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `
|
||||
|
||||
@ -119,7 +119,7 @@ export const RegisterPage = (
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/public/auth-client.js?v=3"></script>
|
||||
<script src="/public/auth-client.js?v=4"></script>
|
||||
<script
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `
|
||||
|
||||
@ -241,9 +241,9 @@ async function startWebAuthnLogin(username) {
|
||||
} catch (_e) {
|
||||
// Fallback to default
|
||||
}
|
||||
setTimeout(() => {
|
||||
globalThis.location.href = targetRedirect;
|
||||
}, 1000);
|
||||
setStatus("Login successful! Redirecting...");
|
||||
window.location.replace(targetRedirect);
|
||||
await new Promise((resolve) => setTimeout(resolve, 5000));
|
||||
} else {
|
||||
setStatus(verificationJSON.error || "Login verification failed", true);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user