-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Choose a user during the Devtool login process (#212)
- Loading branch information
1 parent
4abe251
commit c7444f0
Showing
19 changed files
with
213 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
defmodule DevTool.FakeHydra.Oauth2View do | ||
use DevTool, :view | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
server/lib/dev_tool/templates/fake_hydra/oauth2/choose-user.html.heex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<main class="arrows"> | ||
<nav> | ||
<%= for user_id <- @users do %> | ||
<a href={DevTool.FakeHydra.Router.Helpers.oauth2_path(@conn, :user, user: user_id, redirect_uri: @redirect_uri, scope: @scope, state: @state)}>User <%= user_id %></a> | ||
<% end %> | ||
</nav> | ||
<form action={DevTool.FakeHydra.Router.Helpers.oauth2_path(@conn, :user)}> | ||
<input type="number" name="user" value={@next_id} min="1" step="1"/> | ||
<input type="hidden" name="redirect_uri" value={@redirect_uri}/> | ||
<input type="hidden" name="scope" value={@scope}/> | ||
<input type="hidden" name="state" value={@state}/> | ||
<button type="submit">Select</button> | ||
</form> | ||
</main> |
3 changes: 3 additions & 0 deletions
3
server/lib/dev_tool/templates/fake_hydra/oauth2/logout.html.heex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<script> | ||
window.close(); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<%= @inner_content %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"/> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> | ||
<%= live_title_tag assigns[:page_title] || "Lenra" %> | ||
<link rel="icon" type="image/png" href="/images/favicon.png"/> | ||
<link rel="apple-touch-icon" href="/images/appicon.png"/> | ||
<link phx-track-static rel="stylesheet" href={Routes.static_path(@conn, "/css/style.css")} media="print" onload='this.media="all"'/> | ||
</head> | ||
<body> | ||
<%= @inner_content %> | ||
</body> | ||
</html> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
defmodule DevTool.LayoutView do | ||
use DevTool, :view | ||
|
||
# Phoenix LiveDashboard is available only in development by default, | ||
# so we instruct Elixir to not warn if the dashboard route is missing. | ||
@compile {:no_warn_undefined, {Routes, :live_dashboard_path, 2}} | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
html { | ||
height: 100%; | ||
} | ||
|
||
body { | ||
height: 100%; | ||
} | ||
|
||
main { | ||
margin: auto; | ||
width: 100%; | ||
max-width: 40rem; | ||
height: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
gap: 2rem; | ||
} | ||
|
||
nav { | ||
--size: 5rem; | ||
display: flex; | ||
flex-wrap: wrap; | ||
gap: 1rem; | ||
justify-content: center; | ||
list-style-type: none; | ||
padding: 0; | ||
margin: 0; | ||
width: 100%; | ||
max-width: 40rem; | ||
overflow: auto; | ||
} | ||
|
||
nav a { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
padding: 0.5rem; | ||
border: 1px solid #ccc; | ||
border-radius: 1rem; | ||
text-decoration: none; | ||
color: #333; | ||
|
||
width: var(--size); | ||
height: var(--size); | ||
} |