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

Highlight cors for header authorization in doc #106

Open
deniciocode opened this issue Dec 8, 2021 · 1 comment
Open

Highlight cors for header authorization in doc #106

deniciocode opened this issue Dec 8, 2021 · 1 comment

Comments

@deniciocode
Copy link

Only by allowing specific headers I was able to make an authorised request to the api.

 Rails.application.config.middleware.insert_before 0, Rack::Cors do
   allow do
     origins 'localhost:4200', 'http://localhost:4200/'

     resource '*',
       headers: ['Authorization', 'X-Refresh-Token', 'X-CSRF-Token'],
       expose: ['Authorization', 'X-Refresh-Token', 'X-CSRF-Token'],
       credentials: true,
       max_age: 600,
       methods: [:get, :post, :put, :patch, :delete, :options, :head]
   end
 end
@deniciocode
Copy link
Author

max_age is not needed.

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