I’m using localStorage in my app to store authentication data so that my users don’t have to log in every time they use the app. It looks like it’s working when I run it while developing, but then when it’s used in production it seems like users have to log in every other day.
Is localStorage cleared sporadically in ionic apps?
You didn’t mention the whole story. How are you authenticating a backend server ? A php script ?
A node engine ? If so. The official answer is Passport.
How critical is this ? Do you need change-password , forgot-password and signup?
I hate to be a buzz kill to tell you to change your design but
I would use firebase or Auth0 for login mechanism.
Unless you can use node +passport+ bcrypt.
Firebase auth takes about 20 minutes to set up.
Okay, so I may have expressed myself unclear - but I’m not storing any passwords in localStorage. But I am storing accessToken and refreshTokens in there. Does that change anything?
According to Auth0:
Refresh tokens are subject to strict storage requirements to ensure that they are not leaked.
How would someone with malicious intent access localStorage in a mobile/hybrid app? That’s the part I don’t understand.