angularjs - Authentication w/ Express/Nodejs from Appgyver Supersonic Mobile App -
my ignorance shining brightly on one. have web app uses mean stack (mongo, express, angularjs, nodejs) , of functionality lackluster on mobile devices. i'm developing mobile version of app on appgyver supersonic platform. appgyver framework based on angularjs front-end.
so hoping use same express/nodejs server have running web app , make queries/requests mobile app. authentication current challenge. assumed send username , password via post request , sign in , create new session. can sign in can't access session cookie connect.sid next request has no session data it.
tldr; have angular app on different server express/nodejs back-end. wish authenticate angular app can't figure out how access connect.sid cookie.
since never got traction , found think 'workable' solution figure i'll answer own question. if see i'm doing stupid here, please let me know.
when login client server, respond session token. store same token on user profile in mongoose. store token on mobile device using localstorage.
whenever send request server send token it, , have server check see if token matches user token - if does, grab user profile data , assign req.user; seems make back-end operate properly.
any major security concerns?
Comments
Post a Comment