Skip to content

Commit

Permalink
Update recipe_sonata_admin_without_user_bundle.rst (#6852)
Browse files Browse the repository at this point in the history
Return type method getLoginUrl() of base class AbstractFormLoginAuthenticator is string, so getLoginUrl must return string. Otherwise, opening route /admin/login/ (with slash on the end) will show error "Warning: Header may not contain more than a single header, new line detected".
  • Loading branch information
pk1z authored Feb 15, 2021
1 parent 92bbc45 commit 2127a5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/cookbook/recipe_sonata_admin_without_user_bundle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,9 @@ more about it `here <https://symfony.com/doc/4.4/security/guard_authentication.h
return new RedirectResponse($this->router->generate('admin_login'));
}

protected function getLoginUrl(): RedirectResponse
protected function getLoginUrl(): string
{
return new RedirectResponse($this->router->generate('admin_login'));
return $this->router->generate('admin_login');
}

public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey): RedirectResponse
Expand Down

0 comments on commit 2127a5d

Please sign in to comment.