lynndylanhurley / devise_token_auth

Token based authentication for Rails JSON APIs. Designed to work with jToker and ng-token-auth.
Do What The F*ck You Want To Public License
3.54k stars 1.13k forks source link

question: Is the description of Methods correct? #1604

Open kotaesaki opened 1 year ago

kotaesaki commented 1 year ago

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!🙇