From 1bca8bb790b686aac4eaccdffa4994c630b454d7 Mon Sep 17 00:00:00 2001 From: Vika Date: Sun, 18 Aug 2024 00:45:50 +0300 Subject: onboarding: attempt to fix the redirection bug --- templates/javascript/src/onboarding.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/templates/javascript/src/onboarding.ts b/templates/javascript/src/onboarding.ts index 0b455eb..14c1185 100644 --- a/templates/javascript/src/onboarding.ts +++ b/templates/javascript/src/onboarding.ts @@ -113,8 +113,8 @@ form.onsubmit = async (event: SubmitEvent) => { body: JSON.stringify(json), headers: { "Content-Type": "application/json" } }).then(response => { - if (response.status == 201) { - window.location.href = window.location.href; + if (response.status < 400) { + window.location.href = response.headers.get("Location") ?? "/"; } }) } -- cgit 1.4.1