Added http response code
This commit is contained in:
@@ -8,16 +8,16 @@ if(isLogin()){
|
||||
$password = Password::firstWhere("group_id", groupViaToken($_SESSION["token"])->id);
|
||||
if(passwordValidate($pass = $_POST['password'])){
|
||||
$password->password = password_hash($pass,PASSWORD_DEFAULT);
|
||||
$password->save();
|
||||
header("location: ../../../Frontend/index.html?success=PasswordUpdated");
|
||||
exit();
|
||||
if(!$password->save()){
|
||||
http_response_code(500);
|
||||
}else{
|
||||
http_response_code(201);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
header("location: ../../../Frontend/index.html?error=CouldNotUpdated");
|
||||
exit();
|
||||
http_response_code(400);
|
||||
}
|
||||
|
||||
}else{
|
||||
header("location: ../../../Frontend/index.html?error=NotLogin");
|
||||
exit();
|
||||
http_response_code(401);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user