Arcader7171 commited on
Commit
4db9a03
·
verified ·
1 Parent(s): c28382a

Update templates/signup.html

Browse files
Files changed (1) hide show
  1. templates/signup.html +9 -1
templates/signup.html CHANGED
@@ -15,7 +15,15 @@
15
  header: {"Content-Type": "application/json"},
16
  body: JSON.stringify({username: userInput.value, password: passInput.value})
17
  })
18
- .then(response => response.json())
 
 
 
 
 
 
 
 
19
  }
20
  }
21
  )
 
15
  header: {"Content-Type": "application/json"},
16
  body: JSON.stringify({username: userInput.value, password: passInput.value})
17
  })
18
+ .then(response => {
19
+ if (!response.ok) {
20
+ console.error("Error when signing up");
21
+ }
22
+ return response.json()
23
+ })
24
+ .then(response => {
25
+ window.location.href = "/login"
26
+ })
27
  }
28
  }
29
  )