mirror of
https://github.com/team-alembic/ash_authentication_phoenix.git
synced 2024-09-19 13:03:50 +12:00
fix: set tenant in sign_in and reset_route (#478)
This commit is contained in:
parent
1114d929d2
commit
ef856bf14e
1 changed files with 19 additions and 8 deletions
|
@ -183,13 +183,17 @@ defmodule AshAuthentication.Phoenix.Router do
|
|||
end)
|
||||
|
||||
live_session_opts = [
|
||||
session: %{
|
||||
"overrides" => unquote(overrides),
|
||||
"otp_app" => unquote(otp_app),
|
||||
"path" => unquote(path),
|
||||
"reset_path" => unquote(reset_path),
|
||||
"register_path" => unquote(register_path)
|
||||
},
|
||||
session:
|
||||
{AshAuthentication.Phoenix.Router, :generate_session,
|
||||
[
|
||||
%{
|
||||
"overrides" => unquote(overrides),
|
||||
"otp_app" => unquote(otp_app),
|
||||
"path" => unquote(path),
|
||||
"reset_path" => unquote(reset_path),
|
||||
"register_path" => unquote(register_path)
|
||||
}
|
||||
]},
|
||||
on_mount: on_mount
|
||||
]
|
||||
|
||||
|
@ -295,7 +299,9 @@ defmodule AshAuthentication.Phoenix.Router do
|
|||
end)
|
||||
|
||||
live_session_opts = [
|
||||
session: %{"overrides" => unquote(overrides), "otp_app" => unquote(otp_app)},
|
||||
session:
|
||||
{AshAuthentication.Phoenix.Router, :generate_session,
|
||||
[%{"overrides" => unquote(overrides), "otp_app" => unquote(otp_app)}]},
|
||||
on_mount: on_mount
|
||||
]
|
||||
|
||||
|
@ -314,4 +320,9 @@ defmodule AshAuthentication.Phoenix.Router do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
@doc false
|
||||
def generate_session(conn, session) do
|
||||
Map.put(session, "tenant", Ash.PlugHelpers.get_tenant(conn))
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue