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 -8
View File
@@ -19,20 +19,18 @@ if(isset($_POST['aLogin'])){
$_SESSION['userName'] = $userName;
$_SESSION['admin'] = true;
$_SESSION['success'] = "You are now logged in";
header('location: ../../../Frontend/index.html?login=success');
http_response_code(200);
}else{
session_destroy();
header('location: ../../../Frontend/index.html?login=failed?reason=password');
exit();
echo "Fail to verify password";
http_response_code(401);
}
}else{
session_destroy();
header('location: ../../../Frontend/index.html?login=failed?reason=username');
exit();
echo "No user";
http_response_code(401);
}
}else{
header("location: ../../../Frontend/index.html?error=NoLogin");
exit();
http_response_code(400);
}