73 lines
1.8 KiB
Text
73 lines
1.8 KiB
Text
{% import "source.toby3d.me/toby3d/auth/internal/domain" %}
|
|
|
|
{% code type HomePage struct {
|
|
BaseOf
|
|
Client *domain.Client
|
|
State string
|
|
} %}
|
|
|
|
{% collapsespace %}
|
|
{% func (p *HomePage) Head() %}
|
|
{%= p.BaseOf.Head() %}
|
|
{% for i := range p.Client.RedirectURI %}
|
|
<link rel="redirect_uri" href="{%s p.Client.RedirectURI[i].String() %}">
|
|
{% endfor %}
|
|
{% endfunc %}
|
|
|
|
{% func (p *HomePage) Body() %}
|
|
<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">
|
|
|
|
<h1>
|
|
<a
|
|
class="p-name u-url"
|
|
href="{%s p.Client.GetURL().String() %}">
|
|
|
|
{%s p.Client.GetName() %}
|
|
</a>
|
|
</h1>
|
|
</header>
|
|
|
|
<main>
|
|
<form
|
|
method="get"
|
|
action="/authorize"
|
|
enctype="application/x-www-form-urlencoded"
|
|
accept-charset="utf-8"
|
|
target="_self">
|
|
|
|
{% for name, value := range map[string]string {
|
|
"client_id": p.Client.ID.String(),
|
|
"redirect_uri": p.Client.RedirectURI[0].String(),
|
|
"response_type": domain.ResponseTypeCode.String(),
|
|
"state": p.State,
|
|
"scope": domain.Scopes{domain.ScopeProfile, domain.ScopeEmail}.String(),
|
|
} %}
|
|
<input
|
|
type="hidden"
|
|
name="{%s name %}"
|
|
value="{%s value %}">
|
|
{% endfor %}
|
|
|
|
<input
|
|
type="url"
|
|
name="me"
|
|
placeholder="https://example.com/"
|
|
inputmode="url"
|
|
autocomplete="url"
|
|
required>
|
|
|
|
<button type="submit">{%= p.T("Sign In") %}</button>
|
|
</form>
|
|
</main>
|
|
{% endfunc %}
|
|
{% endcollapsespace %}
|