mirror of
https://github.com/team-alembic/ash_authentication.git
synced 2024-09-20 21:33:10 +12:00
bab9ec363e
* fix(PasswordReset): Generate the reset token using the target action, not the source action. Also improve tests. * improvement(PasswordReset): rework PasswordReset to be a provider in it's own right - this means it has it's own routes, etc.
53 lines
1.7 KiB
Elixir
53 lines
1.7 KiB
Elixir
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>Ash Authentication</title>
|
|
<meta charset="utf-8">
|
|
</head>
|
|
<body>
|
|
<h1>Ash Authentication</h1>
|
|
<%= if Enum.any?(@resources) do %>
|
|
<h2>Resources:</h2>
|
|
|
|
<%= for config <- @resources do %>
|
|
<h2><%= inspect(config.subject_name) %> - <%= Ash.Api.Info.short_name(config.api) %> / <%= Ash.Resource.Info.short_name(config.resource) %></h2>
|
|
|
|
<%= for provider <- config.providers do %>
|
|
<%= Module.concat(provider, Html).request(config.resource, action: "/auth/#{config.subject_name}/#{provider.provides(config.resource)}") %>
|
|
<%= Module.concat(provider, Html).callback(config.resource, action: "/auth/#{config.subject_name}/#{provider.provides(config.resource)}/callback") %>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<h2>Validate token</h2>
|
|
<form method="post" action="/token_check">
|
|
<textarea name="token"></textarea>
|
|
<br />
|
|
<input type="submit" value="Check token" />
|
|
</form>
|
|
<% else %>
|
|
<p>
|
|
<strong>No resources configured</strong>
|
|
<br />
|
|
Please see <a href="https://hexdocs.pm/ash_authentication">the documentation</a> for more information.
|
|
</p>
|
|
<% end %>
|
|
|
|
<%= if Enum.any?(@current_users) do %>
|
|
<h2>Current users:</h2>
|
|
<a href="/clear_session">Clear session</a>
|
|
<table>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Value</th>
|
|
</tr>
|
|
<%= for {name, user} <- @current_users do %>
|
|
<tr>
|
|
<td><code><pre>@<%= name %></pre></code></td>
|
|
<td><code><pre><%= inspect user, pretty: true %></pre></code></td>
|
|
</tr>
|
|
<% end %>
|
|
</table>
|
|
<% end %>
|
|
</body>
|
|
</html>
|
|
|