From 054e1a6686cc1ff49610d41a125cf468e3bea776 Mon Sep 17 00:00:00 2001 From: Brian Muller Date: Sun, 7 Apr 2024 10:17:49 -0400 Subject: [PATCH] Allow IDPs to be set dynamically by other plugs --- lib/samly/router_util.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/samly/router_util.ex b/lib/samly/router_util.ex index 66407db..1ac33e9 100644 --- a/lib/samly/router_util.ex +++ b/lib/samly/router_util.ex @@ -8,7 +8,9 @@ defmodule Samly.RouterUtil do @subdomain_re ~r/^(?([^.]+))?\./ - def check_idp_id(conn, _opts) do + def check_idp_id(%Conn{private: %{samly_idp: %IdpData{}}} = conn, _opts), do: conn + + def check_idp_id(conn, _opts), do: conn idp_id_from = Application.get_env(:samly, :idp_id_from) idp_id =