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

Problem with CORS setup and exposing special headers #591

Closed
GarPit opened this issue Mar 30, 2016 · 3 comments
Closed

Problem with CORS setup and exposing special headers #591

GarPit opened this issue Mar 30, 2016 · 3 comments

Comments

@GarPit
Copy link

GarPit commented Mar 30, 2016

Problem with CORS setup and exposing special headers (using master branch):

config/initializers/cors.rb:7:in `block (2 levels) in <top (required)>': undefined method `headers_names' for DeviseTokenAuth:Module (NoMethodError)
@nwade615
Copy link

+1

@ash1day
Copy link
Contributor

ash1day commented Mar 31, 2016

I don't know why headers_names is undefined, but you can write its values.
Like this:

allow do
  origins '*'
  resource '*',
    headers: :any,
    expose: ['access-token', 'expiry', 'token-type', 'uid', 'client'],
    methods: [:get, :post, :options, :delete, :put]
end

(see. lib/devise_token_auth/engine.rb#L38-L42)

@zachfeldman
Copy link
Contributor

Seems like we have a proposed solution, so closing this for now

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

4 participants