Fix login loop for private instances

GET /login and POST /login have 2 distinct route name.

Fixes #1533
This commit is contained in:
ArthurHoaro 2020-09-01 11:26:24 +02:00
parent 0e60b7f174
commit 14fcfb5213

View file

@ -94,7 +94,7 @@ protected function checkOpenShaarli(Request $request, Response $response, callab
&& $this->container->conf->get('privacy.force_login')
// and the current page isn't already the login page
// and the user is not requesting a feed (which would lead to a different content-type as expected)
&& !in_array($next->getName(), ['login', 'atom', 'rss'], true)
&& !in_array($next->getName(), ['login', 'processLogin', 'atom', 'rss'], true)
) {
throw new UnauthorizedException();
}