ログインに失敗した後、アプリケーションはログイン ページにリダイレクトされません。私の security.yml 構成は次のとおりです。
security:
encoders:
Acme\SecurityBundle\Entity\Users: sha512
role_hierarchy:
ROLE_ADMIN: ROLE_USER
providers:
main:
entity: { class: Acme\SecurityBundle\Entity\Users}
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
login:
pattern: ^/login$
security: false
secured_area:
pattern: ^/admin/
form_login:
check_path: /login_check
login_path: /login
logout:
path: /logout
target: /home
access_control:
- { path: ^/admin, roles: ROLE_ADMIN }
これが私のコントローラーです:
class LoginController extends Controller {
/**
* @Route("/login",name="login")
*/
public function loginAction() {
//displays login form and renders the login.html.twig
}
/**
* @Route("/login_check", name="login_check")
*/
public function loginCheckAction() {
// The security layer will intercept this request
}
ログインに失敗した後、次のようなエラーが発生します。
The controller must return a response (null given). Did you forget to add a return statement somewhere in your controller?
500 Internal Server Error - LogicException
symfony に同梱されているデモ内のログイン セクションを試しました。同じ結果が見つかりました。ログイン失敗後にログインフォームにリダイレクトするには、どのような変更を行う必要がありますか?