Comment on page
Authenticate a user
After registering the user, you can authenticate it with its email and password.
All the communication with the server is made in https, so all the data is encrypted.
If the authentication is correct, the api will return the access token.
This token will be put in the
Authorizationheader for each subsequent call to all the MBurger apis.
await MBAuth.authenticateUser('email', 'password');
MBurger offers the possibility to authenticate a user with social networks too.
Socials currently supported:
If the user logs in with apple you need to pass to this function also the name and surname because those cannot be retrieved by the server
You can see if a user is currently authenticated with
If a user is authenticated you can retrieve its access token with
MBAuth.userToken()else this will return
To logout the current user: