fix: Force Pow.Plug.Session to the same key

This commit is contained in:
Robert Prehn 2021-05-17 22:11:57 -05:00
parent 9154810a9b
commit 1f19aa6383
5 changed files with 5 additions and 5 deletions

View file

@ -57,6 +57,6 @@ defmodule Legendary.Admin.Endpoint do
plug Plug.MethodOverride
plug Plug.Head
plug Plug.Session, @session_options
plug Pow.Plug.Session, otp_app: :admin
plug Pow.Plug.Session
plug Legendary.Admin.Router
end

View file

@ -63,7 +63,7 @@ defmodule AppWeb.Endpoint do
plug Plug.MethodOverride
plug Plug.Head
plug Plug.Session, @session_options
plug Pow.Plug.Session, otp_app: :core
plug Pow.Plug.Session
plug PowPersistentSession.Plug.Cookie
plug AppWeb.Router
end

View file

@ -57,6 +57,6 @@ defmodule Legendary.Content.Endpoint do
plug Plug.MethodOverride
plug Plug.Head
plug Plug.Session, @session_options
plug Pow.Plug.Session, otp_app: :content
plug Pow.Plug.Session
plug Legendary.Content.Router
end

View file

@ -12,7 +12,7 @@ defmodule Legendary.AuthWeb.Plugs.RequireAdmin do
def call(conn, _opts) do
IO.puts "XXXXXX"
IO.inspect( Pow.Plug.current_user(conn))
IO.inspect(Pow.Plug.current_user(conn))
IO.puts "XXXXXX"
IO.inspect(conn |> Plug.Conn.fetch_session() |> Plug.Conn.get_session())
IO.puts "XXXXXX"

View file

@ -63,7 +63,7 @@ defmodule Legendary.CoreWeb.Endpoint do
plug Plug.MethodOverride
plug Plug.Head
plug Plug.Session, @session_options
plug Pow.Plug.Session, otp_app: :core
plug Pow.Plug.Session
plug PowPersistentSession.Plug.Cookie
plug Legendary.CoreWeb.Router
end