Paul
Paul

Reputation: 26680

Devise authentication as API only

I'm trying to use Devise authentication with Angular.js. Everything is already working except I want to hide the server-side login form, i.e. the result of /users/sign_in GET request leaving only the possibility of /users/sign_in POST request. Is this possible?

Upvotes: 1

Views: 865

Answers (1)

Adam
Adam

Reputation: 3158

I think you'll need to skip sessions in your devise_for call in routes.rb (or not even call it) and just stick to devise_scope for setting up your sign_in path. So, your routes.rb would look like this:

devise_for :users, :skip => :sessions

devise_scope do
  post "/users/sign_in" => "devise/sessions#create"
  delete "/users/sign_out" => "devise/sessions#destroy"
end

Upvotes: 1

Related Questions