add corsplug
All checks were successful
Build and Publish / build-release (push) Successful in 1m12s

This commit is contained in:
2026-05-13 17:57:24 -05:00
parent 39f5671b2c
commit cd0c0b21b4
2 changed files with 3 additions and 17 deletions

View File

@@ -39,21 +39,7 @@ cors_origin = System.get_env("CORS_ORIGIN", "*")
config :cors_plug, config :cors_plug,
origin: cors_origin, origin: cors_origin,
headers: [ allow_headers: ["*"]
"Authorization",
"x-organization-id",
"Content-Type",
"Accept",
"Origin",
"User-Agent",
"DNT",
"Cache-Control",
"X-Mx-ReqToken",
"Keep-Alive",
"X-Requested-With",
"If-Modified-Since",
"X-CSRF-Token"
]
# Zitadel Configuration # Zitadel Configuration

View File

@@ -25,8 +25,7 @@ defmodule PolicyServiceWeb.Endpoint do
from: :policy_service, from: :policy_service,
gzip: not code_reloading?, gzip: not code_reloading?,
only: PolicyServiceWeb.static_paths(), only: PolicyServiceWeb.static_paths(),
raise_on_missing_only: code_reloading?, raise_on_missing_only: code_reloading?
headers: %{"Access-Control-Allow-Origin" => "*"}
# Code reloading can be explicitly enabled under the # Code reloading can be explicitly enabled under the
# :code_reloader configuration of your endpoint. # :code_reloader configuration of your endpoint.
@@ -43,6 +42,7 @@ defmodule PolicyServiceWeb.Endpoint do
pass: ["*/*"], pass: ["*/*"],
json_decoder: Phoenix.json_library() json_decoder: Phoenix.json_library()
plug CORSPlug
plug Plug.MethodOverride plug Plug.MethodOverride
plug Plug.Head plug Plug.Head
plug Plug.Session, @session_options plug Plug.Session, @session_options