Pārlūkot izejas kodu

redirect for login & logout

main
Lennart Verschelden pirms 2 gadiem
vecāks
revīzija
8a0f4e4b07
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2
    2
      public/index.php

+ 2
- 2
public/index.php Parādīt failu

@@ -59,7 +59,7 @@ $app->get('/logout', function(Request $request, Response $response, array $args)
addNavbar($response);
$response->getBody()->write('logged out');
addFooter($response);
return $response;
return $response->withHeader('location', '/')->withStatus(302);
});

$app->map(['GET', 'POST'],'/login', function (Request $request, Response $response, array $args) {
@@ -79,7 +79,7 @@ $app->map(['GET', 'POST'],'/login', function (Request $request, Response $respon
addNavbar($response);
$response->getBody()->write('logged in');
addFooter($response);
return $response->withHeader('location', '/')->withStatus(302);
} else {
$response->getBody()->write('username and/or password incorrect');
}

Notiek ielāde…
Atcelt
Saglabāt