hi everyone , i actually have a problem Unable to find the controller for path "/api/login_check". The route is wrongly configured.]

hi everyone , i actually have a problem Unable to find the controller for path "/api/login_check". The route is wrongly configured.]

Unable to find the controller for path “/api/login_check”. The route is wrongly configure***d.
***security:
encoders:
FOSUserBundleModelUserInterface: bcrypt
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: ROLE_ADMIN
# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
providers:
fos_userbundle:
id: fos_user.user_provider.username
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
login:
pattern: ^/api/login
stateless: true
anonymous: true
json_login:
check_path: /api/login_check
username_path: username
password_path: password
success_handler: lexik_jwt_authentication.handler.authentication_success
failure_handler: lexik_jwt_authentication.handler.authentication_failure
require_previous_session: false
api:
pattern: ^/api
stateless: true
provider: fos_userbundle
anonymous: true
guard:
authenticators:
– lexik_jwt_authentication.jwt_token_authenticator
main:
pattern: ^/
form_login:
provider: fos_userbundle
csrf_token_generator: security.csrf.token_manager
logout: true
anonymous: true
# Easy way to control access for large sections of your site
# Note: Only the first access control that matches will be used
access_control:
– { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
– { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
– { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
– { path: ^/admin/, role: ROLE_ADMIN }
– { path: ^/api/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
– { path: ^/api, roles: IS_AUTHENTICATED_FULLY }

Source: Symfony Questions

Leave a Reply

Your email address will not be published. Required fields are marked *