Fixed login error where no error message was shown, now it does

Signed-off-by: rodude123 <rodude123@gmail.com>
This commit is contained in:
Rohit Pai 2022-11-01 04:59:39 +00:00
parent 485c1e27c3
commit eeb8c5b80f
2 changed files with 2 additions and 0 deletions

1
dist/api/index.php vendored
View File

@ -405,6 +405,7 @@ $app->post("/user/login", function (Request $request, Response $response)
$response->getBody()->write(json_encode(array("token" => $_SESSION["token"]))); $response->getBody()->write(json_encode(array("token" => $_SESSION["token"])));
return $response; return $response;
} }
$response->getBody()->write(json_encode(array("error" => "Unauthorised")));
return $response->withStatus(401); return $response->withStatus(401);
}); });

View File

@ -405,6 +405,7 @@ $app->post("/user/login", function (Request $request, Response $response)
$response->getBody()->write(json_encode(array("token" => $_SESSION["token"]))); $response->getBody()->write(json_encode(array("token" => $_SESSION["token"])));
return $response; return $response;
} }
$response->getBody()->write(json_encode(array("error" => "Unauthorised")));
return $response->withStatus(401); return $response->withStatus(401);
}); });