I have created a logic for auto login on my Ionic app (for regular user account or facebook via Apperyio.User.loginFB).
One possibility is the session token get expired after some time, so the app needs to re-login automatically. The problem is that for FB I was receiving error code DBEL002 description: Invalid session token specified.
After some troubleshooting I realized the app was sending the expired token to try to login again, and for that reason the login was denied. So I need to clean up the token before try to login again. Just include the code below before new logon attempt:
code Apperyio.User.invalidate(); /code
No further assistance is required.