diff --git a/lib/safira_web/cors.ex b/lib/safira_web/cors.ex index a3ec363f..da0b1689 100644 --- a/lib/safira_web/cors.ex +++ b/lib/safira_web/cors.ex @@ -1,9 +1,14 @@ defmodule SafiraWeb.CORS do - @moduledoc false + @moduledoc """ + Module responsible for CORS configuration. + Expects CORS_DOMAIN to be set in the environment. + Examples: "localhost:3000", "seium.org" + """ + @domain System.get_env("CORS_DOMAIN") use Corsica.Router, - origins: ~r{^https?::#{@domain}}, + origins: ~r{^https?://#{@domain}}, log: [rejected: :error, invalid: :warn, accepted: :debug], allow_headers: :all, allow_credentials: true,