devise_token_auth icon indicating copy to clipboard operation
devise_token_auth copied to clipboard

question: Is the description of Methods correct?

Open kotaesaki opened this issue 1 year ago • 0 comments

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

kotaesaki avatar Jun 21 '23 04:06 kotaesaki