First off, I\'m no pro.
In my quest to become a better developer I am trying to understand what is needed and how to accomplish creating a sign-up/login for an Ionic-Fra
I actually needed something like that for a few apps I'm working on. I spent quite some time investigating this and was able to achieve that.
I'm pretty happy with the result, in addition to email/password authentication I've added some social authentication which works in the same way.
Download the apk and test it.
If this is what you're looking for you can checkout both the client side code at : https://github.com/malikov/Authenticate.me-client-cordova-ionic
And the server side code at : https://github.com/malikov/Authenticate.me-Node-Server
nathvarun gave a very complete answer, but I'd like to share the steps I do for authentication in my app.
email
+ password
via ajax to the servertoken
in the server and send it back to the appemail
+ token
in localStorage
email
+ token
via POST
true
the method is executed, if false
I send back to the app an error (401)Nice thing is that when the app is open, you can get the email
+ token
from localStorage
, send to the server, if that token is ok for that user, redirect to main screen, otherwise redirect to login. Then whenever user clears the cache of the app, he is redirected to login screen.