You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have namespaced the route just septate it from the application controller. However the request for login and creating a new user as still using the application controller which is causing my application to break since I've active admin there. How do I explicitly tell the devise_token__auth which base controller to use.
here is the structure of my application.
app/controller/application_controller.rb - for devise and active admin
app/controller/api_controller.rb - here is the controller I want to use for the devise auth token.
route.rb
devise_for :users
namespace :api do
scope :v1 do
mount_devise_token_auth_for 'User', at: 'auth'
end
end
The text was updated successfully, but these errors were encountered:
If you want a user to sign in via devise token auth, he should sign in at "app/api/v1/sign_in" (via POST and maybe JSON format)
After this, all your api related requests should goes to your api related controller. I would recommend you read this https://labs.kollegorna.se/blog/2015/04/build-an-api-now/ (it's not using devise auth token for authentication, but other parts should work for your case)
I have namespaced the route just septate it from the application controller. However the request for login and creating a new user as still using the application controller which is causing my application to break since I've active admin there. How do I explicitly tell the devise_token__auth which base controller to use.
here is the structure of my application.
app/controller/application_controller.rb - for devise and active admin
app/controller/api_controller.rb - here is the controller I want to use for the devise auth token.
route.rb
The text was updated successfully, but these errors were encountered: