Hi, i working on application with user authentication from server and i want to ask how do you authenticate your users in ionic app.
Here is how i do it:
I use https://github.com/lynndylanhurley/devise_token_auth on rail server. In app side i use https://github.com/lynndylanhurley/ng-token-auth. ng-auth-token gets token from server and stores it to localStorage. So every request and response have token in header. Server is configured not to refresh token after every request, but keep it. Actually it works good mostly.
But here what problem i faced now. iOs sometimes clear localstorage and user is logged out randomly. I found solution to use https://www.npmjs.com/package/cordova-plugin-nativestorage or sqlLite. As usually it not so easy 
ngAuthToken offers possibility to config your custom storage with three methods to set, retrieve and delete items. (auth token saves tokens there)
- First problem is that
custom storageis configured inapp.configand$cordovaNativeStorageis reachable only when app is ready. - Second, even if somehow i manage to access
$cordovaNativeStorageit return promises, which ng-auth-token is not support as response from storage.
Anyway i stucked here with question. Should i reimplement easier way without ng-auth-token or there is some solution here? Thank you 