YanshuoH / NOMP-Web

NOMP node.js version
0 stars 7 forks source link

add acceptance of params in get request #186

Closed phamour closed 10 years ago

phamour commented 10 years ago

hacking the get s without auth, usable on mobile request it's really hacking to do it this way but i'm really not sure about how to build a request with authentification coz i've been studying the web req/res for the last 3 hours but i didn't figured out how could the server authenticate the request ONLY by parameters or cookies or something unlike sessions. regret for this.

YanshuoH commented 10 years ago

Check config/routes. You login, passport will check the login/pwd, then create a session for you. Now your req should have isAuthenticated() === true. But I'm not sure it is the same thing in mobile phone. In any case, you can force the params of user_actor_type (as you've done in the PR). I meant to do it this way without authentication to avoid problems in API.

YanshuoH commented 10 years ago

Check this out. http://stackoverflow.com/questions/7990890/how-to-implement-login-auth-in-node-js

If you have session.user_id, then you're good to go.