2022-07-28 18:13:24 +00:00
|
|
|
{% import (
|
|
|
|
"source.toby3d.me/toby3d/auth/internal/domain"
|
|
|
|
) %}
|
2021-12-29 21:08:09 +00:00
|
|
|
|
2022-01-04 17:31:33 +00:00
|
|
|
{% code type HomePage struct {
|
|
|
|
BaseOf
|
2022-01-20 19:50:15 +00:00
|
|
|
Client *domain.Client
|
|
|
|
State string
|
2022-01-04 17:31:33 +00:00
|
|
|
} %}
|
2021-12-29 21:08:09 +00:00
|
|
|
|
|
|
|
{% collapsespace %}
|
|
|
|
{% func (p *HomePage) Head() %}
|
2023-01-16 10:19:22 +00:00
|
|
|
{%= p.BaseOf.Head() %}
|
|
|
|
{% for i := range p.Client.RedirectURI %}
|
|
|
|
<link rel="redirect_uri"
|
|
|
|
href="{%s p.Client.RedirectURI[i].String() %}">
|
|
|
|
{% endfor %}
|
2021-12-29 21:08:09 +00:00
|
|
|
{% endfunc %}
|
|
|
|
|
|
|
|
{% func (p *HomePage) Body() %}
|
2023-01-16 10:19:22 +00:00
|
|
|
<header class="h-app h-x-app">
|
|
|
|
<img class="u-logo"
|
|
|
|
src="{%s p.Client.GetLogo().String() %}"
|
|
|
|
alt="{%s p.Client.GetName() %}"
|
|
|
|
crossorigin="anonymous"
|
|
|
|
decoding="async"
|
|
|
|
height="140"
|
|
|
|
importance="high"
|
|
|
|
referrerpolicy="no-referrer-when-downgrade"
|
|
|
|
width="140">
|
2021-12-29 21:08:09 +00:00
|
|
|
|
2023-01-16 10:19:22 +00:00
|
|
|
<h1>
|
|
|
|
<a class="p-name u-url"
|
|
|
|
href="{%s p.Client.GetURL().String() %}">
|
2021-12-29 21:08:09 +00:00
|
|
|
|
2023-01-16 10:19:22 +00:00
|
|
|
{%s p.Client.GetName() %}
|
|
|
|
</a>
|
|
|
|
</h1>
|
|
|
|
</header>
|
2021-12-29 21:08:09 +00:00
|
|
|
|
2023-01-16 10:19:22 +00:00
|
|
|
<main>
|
|
|
|
<form class=""
|
|
|
|
method="get"
|
|
|
|
action="/authorize"
|
|
|
|
enctype="application/x-www-form-urlencoded"
|
|
|
|
accept-charset="utf-8"
|
|
|
|
target="_self">
|
2021-12-29 21:08:09 +00:00
|
|
|
|
2023-01-16 10:19:22 +00:00
|
|
|
{% for name, value := range map[string]string{
|
2022-01-20 19:50:15 +00:00
|
|
|
"client_id": p.Client.ID.String(),
|
|
|
|
"redirect_uri": p.Client.RedirectURI[0].String(),
|
|
|
|
"response_type": domain.ResponseTypeCode.String(),
|
|
|
|
"state": p.State,
|
2021-12-29 21:08:09 +00:00
|
|
|
} %}
|
2023-01-16 10:19:22 +00:00
|
|
|
<input type="hidden"
|
|
|
|
name="{%s name %}"
|
|
|
|
value="{%s value %}">
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
{% for _, scope := range []domain.Scope{
|
2022-06-22 14:24:12 +00:00
|
|
|
domain.ScopeEmail,
|
2022-07-28 18:13:24 +00:00
|
|
|
domain.ScopeProfile,
|
2022-06-22 14:24:12 +00:00
|
|
|
} %}
|
2023-01-16 10:19:22 +00:00
|
|
|
<input type="hidden"
|
|
|
|
name="scope[]"
|
|
|
|
value="{%s scope.String() %}">
|
|
|
|
{% endfor %}
|
2021-12-29 21:08:09 +00:00
|
|
|
|
2023-01-16 10:19:22 +00:00
|
|
|
<input type="url"
|
|
|
|
name="me"
|
|
|
|
placeholder="https://example.com/"
|
|
|
|
inputmode="url"
|
|
|
|
autocomplete="url"
|
|
|
|
required>
|
2021-12-29 21:08:09 +00:00
|
|
|
|
2023-01-16 10:19:22 +00:00
|
|
|
<button type="submit">{%= p.T("Sign In") %}</button>
|
|
|
|
</form>
|
|
|
|
</main>
|
2021-12-29 21:08:09 +00:00
|
|
|
{% endfunc %}
|
|
|
|
{% endcollapsespace %}
|