Uncommented the code, shouldn't have been commented in the first place
All checks were successful
🚀 Deploy website on push / 🎉 Deploy (push) Successful in 30s
All checks were successful
🚀 Deploy website on push / 🎉 Deploy (push) Successful in 30s
Signed-off-by: rodude123 <rodude123@gmail.com>
This commit is contained in:
parent
7f96aa9277
commit
591db4dfa3
@ -168,27 +168,24 @@ class userRoutes implements routesInterface
|
|||||||
$this->samlAuth->processResponse();
|
$this->samlAuth->processResponse();
|
||||||
|
|
||||||
$attributes = $this->samlAuth->getAttributes();
|
$attributes = $this->samlAuth->getAttributes();
|
||||||
// $username = $attributes["username"][0];
|
$username = $attributes["username"][0];
|
||||||
// $email = $attributes["email"][0];
|
$email = $attributes["email"][0];
|
||||||
|
|
||||||
$response->getBody()->write(json_encode($attributes));
|
if ($this->user->checkSAMLUser($username, $email))
|
||||||
return $response;
|
{
|
||||||
|
// yay, user is logged in
|
||||||
|
$_SESSION["token"] = $this->user->createToken($username);
|
||||||
|
$_SESSION["username"] = $username;
|
||||||
|
$_SESSION["email"] = $email;
|
||||||
|
|
||||||
// if ($this->user->checkSAMLUser($username, $email))
|
$inactive = 60 * 60 * 48; // 2 days
|
||||||
// {
|
$_SESSION["timeout"] = time() + $inactive;
|
||||||
// // yay, user is logged in
|
|
||||||
// $_SESSION["token"] = $this->user->createToken($username);
|
return $response->withHeader("Location", "https://rohitpai.co.uk/editor/editor.html")->withStatus(302);
|
||||||
// $_SESSION["username"] = $username;
|
}
|
||||||
// $_SESSION["email"] = $email;
|
|
||||||
//
|
$response->getBody()->write(json_encode(array("error" => "Unauthorised")));
|
||||||
// $inactive = 60 * 60 * 48; // 2 days
|
return $response->withStatus(401);
|
||||||
// $_SESSION["timeout"] = time() + $inactive;
|
|
||||||
//
|
|
||||||
// return $response->withHeader("Location", "https://rohitpai.co.uk/editor/editor.html")->withStatus(302);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// $response->getBody()->write(json_encode(array("error" => "Unauthorised")));
|
|
||||||
// return $response->withStatus(401);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$app->post("/user/changePassword", function (Request $request, Response $response)
|
$app->post("/user/changePassword", function (Request $request, Response $response)
|
||||||
|
Loading…
Reference in New Issue
Block a user