Ricardo Amaral
Posts: 0
Joined: Thu Mar 17, 2016 7:33 pm

Workaround for expired token when using Apperyio.User.loginFB - error DBEL002 - Angular / Ionic

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.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Workaround for expired token when using Apperyio.User.loginFB - error DBEL002 - Angular / Ionic

Hello Ricardo,

You are able to set any Session expiration time on the database tab: Image

If you need to do the same in the app - you can use cookies for that, or keep last sessionToken update time, and remove that storage variable if this date is expired.

Luis
Posts: 0
Joined: Sun Feb 21, 2016 11:56 am

Workaround for expired token when using Apperyio.User.loginFB - error DBEL002 - Angular / Ionic

Hi Sergiy, is there a way to get this settings variable value in javascript?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Workaround for expired token when using Apperyio.User.loginFB - error DBEL002 - Angular / Ionic

Hello Luis,

No, it is impossible to change that setting. Because this is a database parameter, which can't be changed with the application.

Return to “Issues”