Reputation: 33
I have a front-end angularJS server that is getting data from a back-end nodeJS server from MySQL DB via middleware. I created a front-end simple login form that needs to send data for authentication to the back-end server (checks if user exists in the db). The back-end server returns user details in the case that the user is found in the DB or prints error login message or redirect to signup screen.
I'm looking for a guide or example on how to create a correct authentication system with sessions and cookies between the two servers.
Thank you.
Upvotes: 2
Views: 1390
Reputation: 1077
You should choose use a token authentication or use cookies.
Take a look at this,it is a good guide :
http://code.tutsplus.com/tutorials/token-based-authentication-with-angularjs-nodejs--cms-22543
Upvotes: 1