Tom
Tom

Reputation: 30698

Symfony firewall check_path preventing logging in

I'm using Symfony 6.3 and having a hard time understanding the check_path option in the firewall configuration. I have two separate firewalled areas with their own authentication. Here is the firewall for one of them:

custom_user_area:
    pattern: ^/custom/
    lazy: true
    provider: custom_user_provider
    form_login:    
        login_path: signin
        check_path: signin

This throws the error "Unable to login as the current route is not covered by any firewall" because Symfony submits the form to the route name in check_path, whereas that path doesn't match the pattern ^/custom/.

The Symfony docs state "Be sure that this URL is covered by your main firewall (i.e. don't create a separate firewall just for check_path URL).". So if this route/URL needs to be covered by a firewall, how can a public login form submit to it?

What am I missing?

Upvotes: 0

Views: 194

Answers (1)

Tom
Tom

Reputation: 30698

Answering my own question as I found the answer.

It seems in Symfony 6 "IS_AUTHENTICATED_ANONYMOUSLY" in the access_control has been changed to "PUBLIC_ACCESS". Go figure.

Upvotes: 0

Related Questions