mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-18 00:06:38 +00:00
Fix broken auth redirect
This commit is contained in:
10
proxy/web/dist/assets/index.js
vendored
10
proxy/web/dist/assets/index.js
vendored
File diff suppressed because one or more lines are too long
2
proxy/web/dist/assets/style.css
vendored
2
proxy/web/dist/assets/style.css
vendored
File diff suppressed because one or more lines are too long
@@ -62,10 +62,11 @@ function App() {
|
||||
fetch(window.location.href, {
|
||||
method: "POST",
|
||||
body: formData,
|
||||
redirect: "follow",
|
||||
redirect: "manual",
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.ok || res.redirected) {
|
||||
if (res.type === "opaqueredirect" || res.status === 0) {
|
||||
setSubmitting("redirect");
|
||||
window.location.reload();
|
||||
} else {
|
||||
handleAuthError(method, "Authentication failed. Please try again.");
|
||||
@@ -92,6 +93,21 @@ function App() {
|
||||
const hasCredentialAuth = methods.password || methods.pin;
|
||||
const hasBothCredentials = methods.password && methods.pin;
|
||||
|
||||
if (submitting === "redirect") {
|
||||
return (
|
||||
<main className="mt-20">
|
||||
<Card className="max-w-105 mx-auto">
|
||||
<Title>Authenticated</Title>
|
||||
<Description>Loading service...</Description>
|
||||
<div className="flex justify-center mt-7">
|
||||
<Loader2 className="animate-spin" size={24} />
|
||||
</div>
|
||||
</Card>
|
||||
<PoweredByNetBird />
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<main className="mt-20">
|
||||
<Card className="max-w-105 mx-auto">
|
||||
|
||||
Reference in New Issue
Block a user