Added http response code

This commit is contained in:
neerholt
2021-03-19 13:25:27 +01:00
parent 409556ca2e
commit 171e0a3765
18 changed files with 103 additions and 112 deletions
+6 -7
View File
@@ -37,19 +37,18 @@ if(isset($_POST['regGroup'])){
$password->remember_token = $token;
if(!$password->save()){
return;
http_response_code(500);
}else{
http_response_code(201);
}
$_SESSION['groupName'] = $groupName;
$_SESSION['token'] = $token;
$_SESSION['success'] = "You are now logged in";
header("location: ../../../Frontend/index.html?success=GroupRegister");
exit();
}else{
header("location: ../../../Frontend/index.html?error=CouldNotValidatePassword");
exit();
http_response_code(400);
}
}else{
header("location: ../../../Frontend/index.html?error=FailedRegister");
exit();
http_response_code(400);
}