Authentication with AngularJs and Devise Rails, Do I need token system? -
i creating application based on rails , angularjs. implement authentication system using gem devise. wondering how it. read articles attribute :token_authenticatable : have put token @ end of requests send.
i have read demo project https://github.com/sectore/cafetownsend-angular-rails have implemented sessionservice can create , delete server session. (i suppose, can use devise job). in rails controler, session[:user_id] know if user authenticated or not...
my question : need token system or cookies system authenticated requests ?
thanks
if server on same domain client, ie: expecting request angular client, , client hosted on same url server, should use cookies on ssl (for simplicity), eg:
your site:
www.myangularsite.com/somepage your server
www.myangularsite.com/someserverfunction they both have same domain.
however, if plan on having server side on different url, maybe api, go tokens, eg:
your site:
www.myangularsite.com/somepage your server
api.myangularsite.com/someserverfunction or myrubyapi.com/someserverfunction the url domain different.
Comments
Post a Comment