You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello
I am not a developer Elixir, so I can't figure out what the problem is myself.
Our team is working with the developments of another team. And we got this stack.
My client application and server application are hosted on different subdomains, so I have cors errors in authorization paths (for example - api/account/v1
/user
/info), due to the header access-control-allow-origin = * and credentials mode = include, and this cannot be done, the browser blocks such requests. I would like to return the access-controll-allow-origin header in such requests and specify the desired domain in it, and take the value for this domain from the env variable.
What I tried to do:
in this file I tried to create a new pipeline and in it to write rules for domain restriction. This code works well if I write values with the string type (for example - "https://my-domain.com/"), but does not work if I try to get values from the ENV variable.
How do I use ENV variables correctly?
I read that env variables in Elixir are divided into compilation variables and runtime variables. This is clearly a compilation variable. But the thing is that my application has several working environments and for each environment I would like to set a different value.
I also have a question - how to properly configure the cors for one end point, and not for the scope. For example - api/account/v2/get_csrf
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello
I am not a developer Elixir, so I can't figure out what the problem is myself.
Our team is working with the developments of another team. And we got this stack.
My client application and server application are hosted on different subdomains, so I have cors errors in authorization paths (for example - api/account/v1

/user
/info), due to the header access-control-allow-origin = * and credentials mode = include, and this cannot be done, the browser blocks such requests. I would like to return the access-controll-allow-origin header in such requests and specify the desired domain in it, and take the value for this domain from the env variable.
What I tried to do:
in this file I tried to create a new pipeline and in it to write rules for domain restriction. This code works well if I write values with the string type (for example - "https://my-domain.com/"), but does not work if I try to get values from the ENV variable.
How do I use ENV variables correctly?
I read that env variables in Elixir are divided into compilation variables and runtime variables. This is clearly a compilation variable. But the thing is that my application has several working environments and for each environment I would like to set a different value.
I also have a question - how to properly configure the cors for one end point, and not for the scope. For example - api/account/v2/get_csrf
Beta Was this translation helpful? Give feedback.
All reactions