I just deployed my Rails app with the forest gem, and the access to app.forestadmin.com shows an error : “Unable to authenticate you”.
I can see a JS error in the dev console:
Access to fetch at ‘https://admin.neocamino.com/forest/authentication’ from origin ‘https://app.forestadmin.com’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: The value of the ‘Access-Control-Allow-Origin’ header in the response must not be the wildcard ‘*’ when the request’s credentials mode is ‘include’.
Is there some kind of configuration to do on the Rails side?
- Rails: 5.2.6
- Gem: forest_liana (7.2.2)
- Project Name: Neocamino
# config/initializers/cors.rb Rails.application.config.middleware.insert_before 0, Rack::Cors do allow do origins '*' resource '*', headers: :any, methods: [:get, :post, :put, :patch, :delete, :options, :head], max_age: 1728000 end end