-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
devise_token_auth for public API, but devise for rest of app? #114
Comments
Yes it is possible, but the client application will need to implement the functionality of ng-token-auth. This includes:
The best way to accomplish this will be to mount the standard devise routes to one path, and to route the devise_token_auth routes to a separate path. Something like this: Rails.application.routes.draw do
# standard devise routes available at /users
devise_for :users
# token auth routes available at /api/v1/auth
namespace :api do
scope :v1 do
mount_devise_token_auth_for 'User', at: 'auth'
end
end
end |
This works quite well. Thank you. |
🤘 |
🤘 ✌️ |
Hi @jdgblinq, What is the configuration of the controllers? I perform the configuration as indicated @lynndylanhurley in the routes but it still does not work. thanks for your help. |
Hello,
We have a rails application with a public JSON API. The same application also has an administrative interface that does not rely on the public JSON API; it's just vanilla Rails. Our AngularJS frontend is a separate application on a separate host. We don't use AngularJS in our Rails app.
In your examples, it seems like everything uses ng-token-auth. Is it possible to use devise_token_auth without ng-token-auth? In other words, can we use devise_token_auth with vanilla Rails forms?
Alternatively, is it possible to limit devise_token_auth to certain routes and use regular devise for the remaining routes?
Thanks,
Jesse
The text was updated successfully, but these errors were encountered: