Hello i have some trouble accessing to my admin
Expected behavior
I’m just expecting to acces normally to my admin in dev environment.
I’m under the rails gem forest_liana . I’ve never had this error before.
I’m stuck on this page without any powers to do anything to change the env key or else…
Actual behavior
The actual behavior is that when it’s asking me to enter my password to unlock the admin i have the message saying that ‘Your admin backend is unreachable. Please check that it is running and respond to http://localhost:3000.’
It happened the first time when i logged out to another forest project and it’s unavailable since this moment.
Here are the logs of my server running =>
- Package Version: In app rails gem
- Database Dialect: PostgreSQL
- Project Name: AbaShoshin
Thank you in advance for your help .
Joé
Hi @Joe_Marc, and welcome to our community.
Do you have any errors in your browser console or in the network tabs?
Also, does this happen on all of your environments or on a specific one ?
Thanks.
Hello @jeffladiray , Thanks for your response.
Only this one apparently but on another projet too on dev env.
Here are the browser console logs, i didn’t change anything, and my CORS configuration is fully open …
Network tab =>
Thanks
my CORS configuration is fully open
What do you mean by that? Did you configure something like rack-cors
within your app?
From what I can see here, the forest_liana
gem should set everything needed to make this work.
Also, does your app relies on a CORS_ORIGINS
environment variable ?
Yes i configured rack-cors here is my config and the one that was working before
config.middleware.use Rack::Cors do
allow do
origins '*'
resource '*',
headers: :any,
methods: [:get, :post, :options, :delete, :put, :patch]
end
end
Yes my app relies on CORS_ORIGINS
.
It seems like the error indicate that the received value for the request /forest/session
is the wildcard value for Access-Control-Allow-Origin
. This stack overflow seems to cover this topic.
I would suggest not to use the *
value, even in dev.
If I understood the error correctly, your value overrides the one in forest_liana
, that’s why the call seems to fail.
3 Likes
Okay that solved it. Apparently due to the fact that i change the cors after i logged in the forest app it didn’t take the changes on the server reboots.
So when i changed accounts it asked me back my password and then took in consideration my previous CORS update.
Thanks a lot for you help
2 Likes