Hi guys!
1- I have a question about the expiration of the user token, because I noticed that when a password is updated (using user.update(…)) the user token is lost (or expires) and we can’t use the app anymore (every query to the server returns the exception: {“message”:“Not existing user token. Relogin user to update your user token”,“code”:3064}), until we relogin to the app with the new password.
2- The same happens if the password is not updated successfully (i.e when an exception is thrown in beforeUpdate event handler in the business logic) and then, the user is not able to try again to update his password or use the app because the user-token problem happens again.
I not sure if there is a problem here or you guys can guide me to use the update user password correctly.
Thanks in advance,
Alejandro.
Hi Alejandro!
1 - it works as expected;
2 - yes, it is a problem. We will fix it with next update.
Try to use restore password https://backendless.com/documentation/users/rest/users_password_recovery.htm
instead of update operation.
Regards,
Kate.
Hi Kate!
So for the point 1, the only option is to logout the user when he/she successfully update the password?
I’m interested to know if somehow we can keep the session of the user in this case.
We use the update operation because we have some logic in the beforeUpdate event handler in order to keep up to date the user password in other database.
Thanks for the answer!
Regards,
Alejandro
Hi Alejandro,
Since you know the new password for the user and you know the user identity, how about running an API call to re-login the user right after the update so you can get an updated user-token?
Regards,
Mark