Gagan93
Gagan93

Reputation: 1876

Angular Rails app with authentication and token

I am building a very simple app using angular js as frontend and rails as backend. When building only using rails, it was simple to use devise gem and work with rails views (erb). But now the scene is entirely different for me. I wish to keep both the codebases in separate repositories and run both servers separately (grunt and rails server). Here are my queries (if somebody could answer)

  1. How to manage authentication ? I tried using angular devise but it was not overriding hostname and port for all requests, I had to do it for all type of requests. Also, devise renders its own views after authentication is complete or if it fails. For sessions#new controller, it never lets me override and does its own work.
  2. Any other recommended approach/ a gist or a tutorial which can guide me to manage sessions between rails/angular js ? I am new to this approach (rails-angular thing)

Thanks alot in advance !

Upvotes: 1

Views: 191

Answers (1)

Pardeep Saini
Pardeep Saini

Reputation: 2102

Devise is the best option for authentication.

For Rails backend follow this admin static content

For angular frontend follow this Angular Admin UI

Upvotes: 1

Related Questions