0

I have 'device_token_auth' (0.1.36) gem for the token generation in my ROR web application. I am not much aware of the functionality of this gem. Suddenly an issue come as

NoMethodError: undefined method `[]' for nil:NilClass

And the backtrace picture is as, enter image description here

The source code for the same gem, device_token_auth

After looking to the code it can be interpreted that tokens[client_id] or tokens is missing but since the caller's app/controllers/devise_token_auth/concerns/set_user_by_token.rb:75 in update_auth_header method update_auth_header is handeling this case already.

Can someone tell me what is the issue?

shubham mishra
  • 1,183
  • 14
  • 21

2 Answers2

0

I think the version you are using is a bit old which is a known issue as per this. It was fixed in later versions. Try upgrading the gem and let me know if the issue still persists.

Ravi Teja Dandu
  • 466
  • 2
  • 7
0

In config/application.rb after "class Application < Rails::Application" add the following 2 lines:

config.middleware.use ActionDispatch::Cookies
config.middleware.use ActionDispatch::Session::CookieStore
nourza
  • 2,215
  • 2
  • 16
  • 42