How to stay login forever in ionic

how to stay login forever in my app

Depends on how your login works. OAuth? Local? API?

LOGIN IS BASED ON API. APP LOGIN WITH BY USING MOBILE NUMBER AND OTP.
IF BOTH ARE CORRECT API GIVES TOKEN. How CAN I stay login forever?

IF YOUR TOKEN EXPIRES ON THE SERVER, THAN YOU CAN’T. IT WILL DEPEND ON YOUR API AUTHENTICATION SETTINGS. YOU CAN STORE THE GIVEN TOKEN IN THE LOCALSTORAGE TO KEEP USING it.

2 Likes

EXPIRES in 24 hours.But thanks for the solution.

With OAuth you may also receive a refresh token, which you can automatically swap for a new access token when expired.

1 Like