more on authentication
This commit is contained in:
		
							parent
							
								
									94826533f0
								
							
						
					
					
						commit
						e9e11843b8
					
				
					 3 changed files with 5 additions and 9 deletions
				
			
		|  | @ -9,8 +9,8 @@ config :bcrypt_elixir, :log_rounds, 1 | |||
| # to provide built-in test partitioning in CI environment. | ||||
| # Run `mix help test` for more information. | ||||
| config :scopes, Scopes.Repo, | ||||
|   username: "postgres", | ||||
|   password: "postgres", | ||||
|   username: "testuser", | ||||
|   password: "secret", | ||||
|   hostname: "localhost", | ||||
|   database: "scopes_test#{System.get_env("MIX_TEST_PARTITION")}", | ||||
|   pool: Ecto.Adapters.SQL.Sandbox, | ||||
|  |  | |||
|  | @ -3,9 +3,4 @@ defmodule ScopesWeb.DemoHTML do | |||
| 
 | ||||
|   embed_templates "demo_html/*" | ||||
| 
 | ||||
|   def index(assigns) do | ||||
|     ~H""" | ||||
|     Hello World! | ||||
|     """ | ||||
|   end | ||||
| end | ||||
|  |  | |||
|  | @ -23,7 +23,6 @@ defmodule ScopesWeb.Router do | |||
|     get "/", PageController, :home | ||||
|     get "/demo", DemoController, :index | ||||
|     get "/demo/:messenger", DemoController, :show | ||||
|     live "/bingo/", Bingo | ||||
|   end | ||||
| 
 | ||||
|   # Other scopes may use custom stacks. | ||||
|  | @ -41,7 +40,7 @@ defmodule ScopesWeb.Router do | |||
|     import Phoenix.LiveDashboard.Router | ||||
| 
 | ||||
|     scope "/dev" do | ||||
|       pipe_through :browser | ||||
|       pipe_through [:browser, :require_authenticated_user] | ||||
| 
 | ||||
|       live_dashboard "/dashboard", metrics: ScopesWeb.Telemetry | ||||
|       forward "/mailbox", Plug.Swoosh.MailboxPreview | ||||
|  | @ -68,9 +67,11 @@ defmodule ScopesWeb.Router do | |||
|     pipe_through [:browser, :require_authenticated_user] | ||||
| 
 | ||||
|     live_session :require_authenticated_user, | ||||
|       root_layout: {ScopesWeb.Layouts, :root}, | ||||
|       on_mount: [{ScopesWeb.UserAuth, :ensure_authenticated}] do | ||||
|       live "/users/settings", UserSettingsLive, :edit | ||||
|       live "/users/settings/confirm_email/:token", UserSettingsLive, :confirm_email | ||||
|       live "/bingo", Bingo | ||||
|     end | ||||
|   end | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue