Do I need login function?

Hi,

Do I need login function for a mobile app, so user can use the rest of the api ?

Then, what, should I use access_token?

Thanks

Hi,

access_token is to validate the user for every request. So what you have to do, First you have to check whether username and password is right using login function and return the access_token. After from second request you should send the access_token to validate the user. This behaviour is already handled in yii2 rest service. Please check some REST example

Then, do need to update the token after each successful login? To ensure the security of the token, and to allow only one person can use the same account.

A good Tutorial: http://blog.neattutorials.com/angularjs-and-yii2-part-2-authentication/

Source: https://github.com/neattutorials/angularjs-yii2-part-2-authentication