Skip to content

Commit d6e04f1

Browse files
apply review comments and CoolApp -> coolApp
1 parent ca4277e commit d6e04f1

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/Controller/LoginController.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@ final public function __invoke(ServerRequestInterface $request, array $args): Re
1212
$postBody = $request->getParsedBody();
1313
$response = $this->getResponse();
1414
// var_dump($_SESSION);
15-
if (isset($_SESSION["userid"])) {
16-
$user = $_SESSION["userid"];
15+
if (isset($_SESSION['userid'])) {
16+
$user = $_SESSION['userid'];
1717
$response->getBody()->write("<h1>Already logged in as $user</h1>");
18-
} else if ($postBody["user"] == $_ENV["USER"] && $postBody["password"] == $_ENV["PASSWORD"]) {
19-
$user = $postBody["user"];
18+
} else if ($postBody['user'] == $_ENV['USER'] && $postBody['password'] == $_ENV['PASSWORD']) {
19+
$user = $postBody['user'];
2020
$response->getBody()->write("<h1>Welcome $user</h1>\n");
21-
$_SESSION["userid"] = $user;
22-
print_r("session started\n");
21+
$_SESSION['userid'] = $user;
22+
echo("session started\n");
2323
var_dump($_SESSION);
2424
} else {
2525
// var_dump($postBody);
26-
print_r("cookie:\n");
26+
echo("cookie:\n");
2727
var_dump($_COOKIE);
28-
print_r("session:\n");
28+
echo("session:\n");
2929
var_dump($_SESSION);
3030
$response->getBody()->write("<h1>No (try posting user=alice&password=alice123)</h1>\n");
3131
}

src/Controller/OpenidController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private function getKeys() {
9595
);
9696
}
9797
private function getClientId() {
98-
return "CoolApp";
98+
return "coolApp";
9999
}
100100
private function getClient($clientId, $baseUrl) {
101101
if (!$clientId) {

0 commit comments

Comments
 (0)