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

undefined local variable or method `cookies' for #<Api::MesController:0x00007f93aa1cb9f8> #1538

Closed
dim0627 opened this issue Jun 13, 2022 · 1 comment

Comments

@dim0627
Copy link

dim0627 commented Jun 13, 2022

Hi, thank you for awesome gem, I'm lovin' it.
I need help for Exception like a this issue's title.

I solve it for this patch in ApplicationController, Is it bug?

  def set_cookie(auth_header) # rubocop:disable Naming/AccessorMethodName
    request.cookies[DeviseTokenAuth.cookie_name] = DeviseTokenAuth.cookie_attributes.merge(value: auth_header.to_json)
  end

devise_token_auth (1.2.0)

  • Request and response headers: these can be found in the "Network" tab of your browser's web inspector.
  • Rails Stacktrace: this can be found in the log/development.log of your API.
  • Environmental Info: How is your application different from the reference implementation? This may include (but is not limited to) the following details:

I just changed this

  config.cookie_enabled = true
  • Routes: are you using some crazy namespace, scope, or constraint?

no

defaults format: :json do
  namespace :api do
    mount_devise_token_auth_for 'User', at: 'auth'
  end
end
  • Gems: are you using MongoDB, Grape, RailsApi, ActiveAdmin, etc.?

no

no

no

@dim0627
Copy link
Author

dim0627 commented Jun 13, 2022

I'm sorry, It's solved this

# ApplicationController
include ActionController::Cookies

@dim0627 dim0627 closed this as completed Jun 13, 2022
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