fix: Force Pow.Plug.Session to the same key
This commit is contained in:
		
							parent
							
								
									9154810a9b
								
							
						
					
					
						commit
						1f19aa6383
					
				
					 5 changed files with 5 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue