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
This is somewhat similar to #399 but it was closed without any solution.
I have a 'Worker' and 'User' model. I am using standard devise for User, and devise_token_auth and standard devise for 'Worker'
routes.rb
devise_for :users
devise_for :workers
namespace :api, defaults: {format: 'json'} do
mount_devise_token_auth_for 'Worker', at: 'auth'
end
Worker model includes DeviseTokenAuth::Concerns::User and it has all the columns required for devise_token_auth to work and the base controller for the api includes DeviseTokenAuth::Concerns::SetUserByToken
/api/auth/sign_in works perfectly
however /api/auth/validate_token fails throwing a undefined method 'find_by_uid' error.
in live console,
app/controllers/devise_token_auth/concerns/set_user_by_token.rb user = uid && rc.find_by_uid(uid)
rc returns User when it should be Worker. mapping returns :user
Is there anything I have left out in configuring devise_token_auth for the Worker model?
The text was updated successfully, but these errors were encountered:
In an effort to cleanup this project and prioritize a bit, we're marking issues that haven't had any activity in a while with a "close-in-7-days" label. If we don't hear from you in about a week, we'll be closing this issue. Obviously feel free to re-open it at any time if it's the right time or this was done in error!
If you are still having the issue (especially if it's a bug report) please refer to our new Issue Template to provide some more details to help us solve it.
This is somewhat similar to #399 but it was closed without any solution.
I have a 'Worker' and 'User' model. I am using standard devise for User, and devise_token_auth and standard devise for 'Worker'
routes.rb
Worker model includes
DeviseTokenAuth::Concerns::User
and it has all the columns required for devise_token_auth to work and the base controller for the api includesDeviseTokenAuth::Concerns::SetUserByToken
/api/auth/sign_in works perfectly
however /api/auth/validate_token fails throwing a undefined method 'find_by_uid' error.
in live console,
app/controllers/devise_token_auth/concerns/set_user_by_token.rb
user = uid && rc.find_by_uid(uid)
rc returns User when it should be Worker. mapping returns :user
Is there anything I have left out in configuring devise_token_auth for the Worker model?
The text was updated successfully, but these errors were encountered: