Skip to content
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

question: Is the description of Methods correct? #1604

Open
kotaesaki opened this issue Jun 21, 2023 · 0 comments
Open

question: Is the description of Methods correct? #1604

kotaesaki opened this issue Jun 21, 2023 · 0 comments

Comments

@kotaesaki
Copy link

docs

https://devise-token-auth.gitbook.io/devise-token-auth/usage/controller_methods#methods

description

Note that if the model that you're trying to access isn't called User, the helper method names will change. For example, if the user model is called Admin, the methods would look like this:

The above is explained above, but the following is actually more correct.

It is automatically generated from the namespace in which "mount_devise_token_auth_for" is written and the model resource name.

This is because the following routing is "authenticate_admin_user!", not "authenticate_user!"

namespace :admin do
  mount_devise_token_auth_for 'User', at: 'auth', skip: [:omniauth_callbacks]
end

I would be glad to know if I am wrong!🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant