about summary refs log tree commit diff
path: root/templates/javascript
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2024-08-18 00:45:50 +0300
committerVika <vika@fireburn.ru>2024-08-18 00:45:50 +0300
commit1bca8bb790b686aac4eaccdffa4994c630b454d7 (patch)
treea3426cdf5f59e6f98e99c3538ed748fdd1a42f8b /templates/javascript
parente43313210269b8e48fe35b17ac416c9ba88ae4f3 (diff)
downloadkittybox-1bca8bb790b686aac4eaccdffa4994c630b454d7.tar.zst
onboarding: attempt to fix the redirection bug
Diffstat (limited to 'templates/javascript')
-rw-r--r--templates/javascript/src/onboarding.ts4
1 files changed, 2 insertions, 2 deletions
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") ?? "/";
         }
     })
 }