mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-05-28 06:20:14 +00:00
Rewrite all AIO interface paths to be relative
Signed-off-by: Lorenzo Moscati <lorenzo@moscati.page>
This commit is contained in:
@@ -19,33 +19,33 @@ readonly class LoginController {
|
||||
public function TryLogin(Request $request, Response $response, array $args) : Response {
|
||||
if (!$this->dockerActionManager->isLoginAllowed()) {
|
||||
$response->getBody()->write("The login is blocked since Nextcloud is running.");
|
||||
return $response->withHeader('Location', '/')->withStatus(422);
|
||||
return $response->withHeader('Location', '.')->withStatus(422);
|
||||
}
|
||||
$password = $request->getParsedBody()['password'] ?? '';
|
||||
if($this->authManager->CheckCredentials($password)) {
|
||||
$this->authManager->SetAuthState(true);
|
||||
return $response->withHeader('Location', '/')->withStatus(201);
|
||||
return $response->withHeader('Location', '.')->withStatus(201);
|
||||
}
|
||||
|
||||
$response->getBody()->write("The password is incorrect.");
|
||||
return $response->withHeader('Location', '/')->withStatus(422);
|
||||
return $response->withHeader('Location', '.')->withStatus(422);
|
||||
}
|
||||
|
||||
public function GetTryLogin(Request $request, Response $response, array $args) : Response {
|
||||
$token = $request->getQueryParams()['token'] ?? '';
|
||||
if($this->authManager->CheckToken($token)) {
|
||||
$this->authManager->SetAuthState(true);
|
||||
return $response->withHeader('Location', '/')->withStatus(302);
|
||||
return $response->withHeader('Location', '../..')->withStatus(302);
|
||||
}
|
||||
|
||||
return $response->withHeader('Location', '/')->withStatus(302);
|
||||
return $response->withHeader('Location', '../..')->withStatus(302);
|
||||
}
|
||||
|
||||
public function Logout(Request $request, Response $response, array $args) : Response
|
||||
{
|
||||
$this->authManager->SetAuthState(false);
|
||||
return $response
|
||||
->withHeader('Location', '/')
|
||||
->withHeader('Location', '.')
|
||||
->withStatus(302);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user