fix: Remove Persistent Session to avoid log out issue
This commit is contained in:
parent
cd9b84488e
commit
a689922c5e
3 changed files with 2 additions and 8 deletions
|
@ -64,6 +64,6 @@ defmodule AppWeb.Endpoint do
|
|||
plug Plug.Head
|
||||
plug Plug.Session, @session_options
|
||||
plug Pow.Plug.Session, otp_app: :core
|
||||
plug PowPersistentSession.Plug.Cookie
|
||||
# plug PowPersistentSession.Plug.Cookie
|
||||
plug AppWeb.Router
|
||||
end
|
||||
|
|
|
@ -11,15 +11,9 @@ defmodule Legendary.AuthWeb.Plugs.RequireAdmin do
|
|||
end
|
||||
|
||||
def call(conn, _opts) do
|
||||
IO.puts "XXXXXX"
|
||||
IO.inspect(Pow.Plug.current_user(conn))
|
||||
IO.puts "XXXXXX"
|
||||
IO.inspect(conn |> Plug.Conn.fetch_session() |> Plug.Conn.get_session())
|
||||
IO.puts "XXXXXX"
|
||||
with user = %User{} <- Pow.Plug.current_user(conn),
|
||||
true <- Roles.has_role?(user, "admin")
|
||||
do
|
||||
IO.puts "OK"
|
||||
conn
|
||||
else
|
||||
_ ->
|
||||
|
|
|
@ -39,7 +39,7 @@ end)
|
|||
config :core, :pow,
|
||||
user: Legendary.Auth.User,
|
||||
repo: Legendary.Core.Repo,
|
||||
extensions: [PowEmailConfirmation, PowPersistentSession, PowResetPassword],
|
||||
extensions: [PowEmailConfirmation, PowResetPassword],
|
||||
controller_callbacks: Pow.Extension.Phoenix.ControllerCallbacks,
|
||||
mailer_backend: Legendary.AuthWeb.Pow.Mailer,
|
||||
web_mailer_module: Legendary.AuthWeb,
|
||||
|
|
Loading…
Reference in a new issue