1
votes

I'm using FOSuserbundle with LexikJWTAuthenticationBundle to handle user authentification and registration for my users with symfony API. I have a client application with Angular which sent http request to log in users which works fine but registration does not and i don't know what configuration i should use. My security.yml for login is :

login:
                pattern:  ^/login
                stateless: true
                anonymous: true
                provider : fos_userbundle
                form_login:
                    check_path:               /login_check
                    username_parameter: _username
                    password_parameter : _password
                    success_handler:          lexik_jwt_authentication.handler.authentication_success
                    failure_handler:          lexik_jwt_authentication.handler.authentication_failure
                    require_previous_session: false

To login from the client i use this :

return this.http.post('http://localhost:8000/login_check', body.toString(), {headers: headers})

But i couldn't find any configuration such that of login in the fosbundle documentation.

PS : registration with FOSbundle forms directly from backend works.

1

1 Answers

0
votes

I don't know what you have in your body but be carefull with it.

Be sure to have the good variable name and don't use the toString(). My login looks like that :

this._http.post(\\login_check route, { _username: this.username, _password: this.password })

And also check your headers to be sure it contains

"Content-Type": application/json