Added http response code
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user