💄 Format and regenerate templates
This commit is contained in:
parent
80937fbb8d
commit
8fa0715116
12 changed files with 440 additions and 446 deletions
|
@ -1,15 +1,17 @@
|
|||
{% import "source.toby3d.me/toby3d/auth/internal/domain" %}
|
||||
{% import (
|
||||
"source.toby3d.me/toby3d/auth/internal/domain"
|
||||
) %}
|
||||
|
||||
{% code type AuthorizePage struct {
|
||||
BaseOf
|
||||
CSRF []byte
|
||||
Providers []*domain.Provider
|
||||
Scope domain.Scopes
|
||||
CodeChallengeMethod domain.CodeChallengeMethod
|
||||
ResponseType domain.ResponseType
|
||||
Client *domain.Client
|
||||
Me *domain.Me
|
||||
RedirectURI *domain.URL
|
||||
CodeChallengeMethod domain.CodeChallengeMethod
|
||||
ResponseType domain.ResponseType
|
||||
Providers []*domain.Provider
|
||||
CSRF []byte
|
||||
CodeChallenge string
|
||||
State string
|
||||
} %}
|
||||
|
@ -25,8 +27,7 @@
|
|||
{% func (p *AuthorizePage) Body() %}
|
||||
<header>
|
||||
{% if p.Client.GetLogo() != nil %}
|
||||
<img
|
||||
alt="{%s p.Client.GetName() %}"
|
||||
<img class=""
|
||||
crossorigin="anonymous"
|
||||
decoding="async"
|
||||
height="140"
|
||||
|
@ -34,6 +35,7 @@
|
|||
loading="lazy"
|
||||
referrerpolicy="no-referrer-when-downgrade"
|
||||
src="{%s p.Client.GetLogo().String() %}"
|
||||
alt="{%s p.Client.GetName() %}"
|
||||
width="140">
|
||||
{% endif %}
|
||||
|
||||
|
@ -53,7 +55,7 @@
|
|||
</header>
|
||||
|
||||
<main>
|
||||
<form
|
||||
<form class=""
|
||||
accept-charset="utf-8"
|
||||
action="/api/authorize"
|
||||
autocomplete="off"
|
||||
|
@ -63,8 +65,7 @@
|
|||
target="_self">
|
||||
|
||||
{% if p.CSRF != nil %}
|
||||
<input
|
||||
type="hidden"
|
||||
<input type="hidden"
|
||||
name="_csrf"
|
||||
value="{%z p.CSRF %}">
|
||||
{% endif %}
|
||||
|
@ -75,8 +76,7 @@
|
|||
"response_type": p.ResponseType.String(),
|
||||
"state": p.State,
|
||||
} %}
|
||||
<input
|
||||
type="hidden"
|
||||
<input type="hidden"
|
||||
name="{%s key %}"
|
||||
value="{%s val %}">
|
||||
{% endfor %}
|
||||
|
@ -88,8 +88,7 @@
|
|||
{% for _, scope := range p.Scope %}
|
||||
<div>
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
<input type="checkbox"
|
||||
name="scope[]"
|
||||
value="{%s scope.String() %}"
|
||||
checked>
|
||||
|
@ -102,33 +101,28 @@
|
|||
{% endif %}
|
||||
|
||||
{% if p.CodeChallenge != "" %}
|
||||
<input
|
||||
type="hidden"
|
||||
<input type="hidden"
|
||||
name="code_challenge"
|
||||
value="{%s p.CodeChallenge %}">
|
||||
|
||||
<input
|
||||
type="hidden"
|
||||
<input type="hidden"
|
||||
name="code_challenge_method"
|
||||
value="{%s p.CodeChallengeMethod.String() %}">
|
||||
{% endif %}
|
||||
|
||||
{% if p.Me != nil %}
|
||||
<input
|
||||
type="hidden"
|
||||
<input type="hidden"
|
||||
name="me"
|
||||
value="{%s p.Me.String() %}">
|
||||
{% endif %}
|
||||
|
||||
{% if len(p.Providers) > 0 %}
|
||||
<select
|
||||
name="provider"
|
||||
<select name="provider"
|
||||
autocomplete
|
||||
required>
|
||||
|
||||
{% for _, provider := range p.Providers %}
|
||||
<option
|
||||
value="{%s provider.UID %}"
|
||||
<option value="{%s provider.UID %}"
|
||||
{% if provider.UID == "mastodon" %}selected{% endif %}>
|
||||
|
||||
{%s provider.Name %}
|
||||
|
@ -136,19 +130,19 @@
|
|||
{% endfor %}
|
||||
</select>
|
||||
{% else %}
|
||||
<input type="hidden" name="provider" value="direct">
|
||||
<input type="hidden"
|
||||
name="provider"
|
||||
value="direct">
|
||||
{% endif %}
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
<button type="submit"
|
||||
name="authorize"
|
||||
value="deny">
|
||||
|
||||
{%= p.T("Deny") %}
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
<button type="submit"
|
||||
name="authorize"
|
||||
value="allow">
|
||||
|
||||
|
|
|
@ -5,111 +5,108 @@
|
|||
package web
|
||||
|
||||
//line web/authorize.qtpl:1
|
||||
import "source.toby3d.me/toby3d/auth/internal/domain"
|
||||
import (
|
||||
"source.toby3d.me/toby3d/auth/internal/domain"
|
||||
)
|
||||
|
||||
//line web/authorize.qtpl:3
|
||||
//line web/authorize.qtpl:5
|
||||
import (
|
||||
qtio422016 "io"
|
||||
|
||||
qt422016 "github.com/valyala/quicktemplate"
|
||||
)
|
||||
|
||||
//line web/authorize.qtpl:3
|
||||
//line web/authorize.qtpl:5
|
||||
var (
|
||||
_ = qtio422016.Copy
|
||||
_ = qt422016.AcquireByteBuffer
|
||||
)
|
||||
|
||||
//line web/authorize.qtpl:3
|
||||
//line web/authorize.qtpl:5
|
||||
type AuthorizePage struct {
|
||||
BaseOf
|
||||
CSRF []byte
|
||||
Providers []*domain.Provider
|
||||
Scope domain.Scopes
|
||||
CodeChallengeMethod domain.CodeChallengeMethod
|
||||
ResponseType domain.ResponseType
|
||||
Client *domain.Client
|
||||
Me *domain.Me
|
||||
RedirectURI *domain.URL
|
||||
CodeChallengeMethod domain.CodeChallengeMethod
|
||||
ResponseType domain.ResponseType
|
||||
Providers []*domain.Provider
|
||||
CSRF []byte
|
||||
CodeChallenge string
|
||||
State string
|
||||
}
|
||||
|
||||
//line web/authorize.qtpl:17
|
||||
//line web/authorize.qtpl:19
|
||||
func (p *AuthorizePage) StreamTitle(qw422016 *qt422016.Writer) {
|
||||
//line web/authorize.qtpl:17
|
||||
//line web/authorize.qtpl:19
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line web/authorize.qtpl:18
|
||||
//line web/authorize.qtpl:20
|
||||
if p.Client.GetName() == "" {
|
||||
//line web/authorize.qtpl:18
|
||||
//line web/authorize.qtpl:20
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line web/authorize.qtpl:19
|
||||
//line web/authorize.qtpl:21
|
||||
p.StreamT(qw422016, "Authorize %s", p.Client.GetName())
|
||||
//line web/authorize.qtpl:19
|
||||
//line web/authorize.qtpl:21
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line web/authorize.qtpl:20
|
||||
//line web/authorize.qtpl:22
|
||||
} else {
|
||||
//line web/authorize.qtpl:20
|
||||
//line web/authorize.qtpl:22
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line web/authorize.qtpl:21
|
||||
//line web/authorize.qtpl:23
|
||||
p.StreamT(qw422016, "Authorize application")
|
||||
//line web/authorize.qtpl:21
|
||||
//line web/authorize.qtpl:23
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line web/authorize.qtpl:22
|
||||
//line web/authorize.qtpl:24
|
||||
}
|
||||
//line web/authorize.qtpl:22
|
||||
//line web/authorize.qtpl:24
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line web/authorize.qtpl:23
|
||||
//line web/authorize.qtpl:25
|
||||
}
|
||||
|
||||
//line web/authorize.qtpl:23
|
||||
//line web/authorize.qtpl:25
|
||||
func (p *AuthorizePage) WriteTitle(qq422016 qtio422016.Writer) {
|
||||
//line web/authorize.qtpl:23
|
||||
//line web/authorize.qtpl:25
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line web/authorize.qtpl:23
|
||||
//line web/authorize.qtpl:25
|
||||
p.StreamTitle(qw422016)
|
||||
//line web/authorize.qtpl:23
|
||||
//line web/authorize.qtpl:25
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line web/authorize.qtpl:23
|
||||
//line web/authorize.qtpl:25
|
||||
}
|
||||
|
||||
//line web/authorize.qtpl:23
|
||||
//line web/authorize.qtpl:25
|
||||
func (p *AuthorizePage) Title() string {
|
||||
//line web/authorize.qtpl:23
|
||||
//line web/authorize.qtpl:25
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line web/authorize.qtpl:23
|
||||
//line web/authorize.qtpl:25
|
||||
p.WriteTitle(qb422016)
|
||||
//line web/authorize.qtpl:23
|
||||
//line web/authorize.qtpl:25
|
||||
qs422016 := string(qb422016.B)
|
||||
//line web/authorize.qtpl:23
|
||||
//line web/authorize.qtpl:25
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line web/authorize.qtpl:23
|
||||
//line web/authorize.qtpl:25
|
||||
return qs422016
|
||||
//line web/authorize.qtpl:23
|
||||
//line web/authorize.qtpl:25
|
||||
}
|
||||
|
||||
//line web/authorize.qtpl:25
|
||||
//line web/authorize.qtpl:27
|
||||
func (p *AuthorizePage) StreamBody(qw422016 *qt422016.Writer) {
|
||||
//line web/authorize.qtpl:25
|
||||
//line web/authorize.qtpl:27
|
||||
qw422016.N().S(`
|
||||
<header>
|
||||
`)
|
||||
//line web/authorize.qtpl:27
|
||||
//line web/authorize.qtpl:29
|
||||
if p.Client.GetLogo() != nil {
|
||||
//line web/authorize.qtpl:27
|
||||
//line web/authorize.qtpl:29
|
||||
qw422016.N().S(`
|
||||
<img
|
||||
alt="`)
|
||||
//line web/authorize.qtpl:29
|
||||
qw422016.E().S(p.Client.GetName())
|
||||
//line web/authorize.qtpl:29
|
||||
qw422016.N().S(`"
|
||||
<img class=""
|
||||
crossorigin="anonymous"
|
||||
decoding="async"
|
||||
height="140"
|
||||
|
@ -117,74 +114,79 @@ func (p *AuthorizePage) StreamBody(qw422016 *qt422016.Writer) {
|
|||
loading="lazy"
|
||||
referrerpolicy="no-referrer-when-downgrade"
|
||||
src="`)
|
||||
//line web/authorize.qtpl:36
|
||||
//line web/authorize.qtpl:37
|
||||
qw422016.E().S(p.Client.GetLogo().String())
|
||||
//line web/authorize.qtpl:36
|
||||
//line web/authorize.qtpl:37
|
||||
qw422016.N().S(`"
|
||||
alt="`)
|
||||
//line web/authorize.qtpl:38
|
||||
qw422016.E().S(p.Client.GetName())
|
||||
//line web/authorize.qtpl:38
|
||||
qw422016.N().S(`"
|
||||
width="140">
|
||||
`)
|
||||
//line web/authorize.qtpl:38
|
||||
//line web/authorize.qtpl:40
|
||||
}
|
||||
//line web/authorize.qtpl:38
|
||||
//line web/authorize.qtpl:40
|
||||
qw422016.N().S(`
|
||||
|
||||
<h2>
|
||||
`)
|
||||
//line web/authorize.qtpl:41
|
||||
//line web/authorize.qtpl:43
|
||||
if p.Client.GetURL() != nil {
|
||||
//line web/authorize.qtpl:41
|
||||
//line web/authorize.qtpl:43
|
||||
qw422016.N().S(`
|
||||
<a href="`)
|
||||
//line web/authorize.qtpl:42
|
||||
//line web/authorize.qtpl:44
|
||||
qw422016.E().S(p.Client.GetURL().String())
|
||||
//line web/authorize.qtpl:42
|
||||
//line web/authorize.qtpl:44
|
||||
qw422016.N().S(`">
|
||||
`)
|
||||
//line web/authorize.qtpl:43
|
||||
//line web/authorize.qtpl:45
|
||||
}
|
||||
//line web/authorize.qtpl:43
|
||||
//line web/authorize.qtpl:45
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line web/authorize.qtpl:44
|
||||
//line web/authorize.qtpl:46
|
||||
if p.Client.GetName() != "" {
|
||||
//line web/authorize.qtpl:44
|
||||
//line web/authorize.qtpl:46
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line web/authorize.qtpl:45
|
||||
//line web/authorize.qtpl:47
|
||||
qw422016.E().S(p.Client.GetName())
|
||||
//line web/authorize.qtpl:45
|
||||
//line web/authorize.qtpl:47
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line web/authorize.qtpl:46
|
||||
//line web/authorize.qtpl:48
|
||||
} else {
|
||||
//line web/authorize.qtpl:46
|
||||
//line web/authorize.qtpl:48
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line web/authorize.qtpl:47
|
||||
//line web/authorize.qtpl:49
|
||||
qw422016.E().S(p.Client.ID.String())
|
||||
//line web/authorize.qtpl:47
|
||||
//line web/authorize.qtpl:49
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line web/authorize.qtpl:48
|
||||
//line web/authorize.qtpl:50
|
||||
}
|
||||
//line web/authorize.qtpl:48
|
||||
//line web/authorize.qtpl:50
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line web/authorize.qtpl:49
|
||||
//line web/authorize.qtpl:51
|
||||
if p.Client.GetURL() != nil {
|
||||
//line web/authorize.qtpl:49
|
||||
//line web/authorize.qtpl:51
|
||||
qw422016.N().S(`
|
||||
</a>
|
||||
`)
|
||||
//line web/authorize.qtpl:51
|
||||
//line web/authorize.qtpl:53
|
||||
}
|
||||
//line web/authorize.qtpl:51
|
||||
//line web/authorize.qtpl:53
|
||||
qw422016.N().S(`
|
||||
</h2>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<form
|
||||
<form class=""
|
||||
accept-charset="utf-8"
|
||||
action="/api/authorize"
|
||||
autocomplete="off"
|
||||
|
@ -194,36 +196,34 @@ func (p *AuthorizePage) StreamBody(qw422016 *qt422016.Writer) {
|
|||
target="_self">
|
||||
|
||||
`)
|
||||
//line web/authorize.qtpl:65
|
||||
//line web/authorize.qtpl:67
|
||||
if p.CSRF != nil {
|
||||
//line web/authorize.qtpl:65
|
||||
//line web/authorize.qtpl:67
|
||||
qw422016.N().S(`
|
||||
<input
|
||||
type="hidden"
|
||||
<input type="hidden"
|
||||
name="_csrf"
|
||||
value="`)
|
||||
//line web/authorize.qtpl:69
|
||||
//line web/authorize.qtpl:70
|
||||
qw422016.E().Z(p.CSRF)
|
||||
//line web/authorize.qtpl:69
|
||||
//line web/authorize.qtpl:70
|
||||
qw422016.N().S(`">
|
||||
`)
|
||||
//line web/authorize.qtpl:70
|
||||
//line web/authorize.qtpl:71
|
||||
}
|
||||
//line web/authorize.qtpl:70
|
||||
//line web/authorize.qtpl:71
|
||||
qw422016.N().S(`
|
||||
|
||||
`)
|
||||
//line web/authorize.qtpl:72
|
||||
//line web/authorize.qtpl:73
|
||||
for key, val := range map[string]string{
|
||||
"client_id": p.Client.ID.String(),
|
||||
"redirect_uri": p.RedirectURI.String(),
|
||||
"response_type": p.ResponseType.String(),
|
||||
"state": p.State,
|
||||
} {
|
||||
//line web/authorize.qtpl:77
|
||||
//line web/authorize.qtpl:78
|
||||
qw422016.N().S(`
|
||||
<input
|
||||
type="hidden"
|
||||
<input type="hidden"
|
||||
name="`)
|
||||
//line web/authorize.qtpl:80
|
||||
qw422016.E().S(key)
|
||||
|
@ -259,188 +259,182 @@ func (p *AuthorizePage) StreamBody(qw422016 *qt422016.Writer) {
|
|||
qw422016.N().S(`
|
||||
<div>
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
<input type="checkbox"
|
||||
name="scope[]"
|
||||
value="`)
|
||||
//line web/authorize.qtpl:94
|
||||
//line web/authorize.qtpl:93
|
||||
qw422016.E().S(scope.String())
|
||||
//line web/authorize.qtpl:94
|
||||
//line web/authorize.qtpl:93
|
||||
qw422016.N().S(`"
|
||||
checked>
|
||||
|
||||
`)
|
||||
//line web/authorize.qtpl:97
|
||||
//line web/authorize.qtpl:96
|
||||
qw422016.E().S(scope.String())
|
||||
//line web/authorize.qtpl:97
|
||||
//line web/authorize.qtpl:96
|
||||
qw422016.N().S(`
|
||||
</label>
|
||||
</div>
|
||||
`)
|
||||
//line web/authorize.qtpl:100
|
||||
//line web/authorize.qtpl:99
|
||||
}
|
||||
//line web/authorize.qtpl:100
|
||||
//line web/authorize.qtpl:99
|
||||
qw422016.N().S(`
|
||||
</fieldset>
|
||||
`)
|
||||
//line web/authorize.qtpl:102
|
||||
//line web/authorize.qtpl:101
|
||||
}
|
||||
//line web/authorize.qtpl:102
|
||||
//line web/authorize.qtpl:101
|
||||
qw422016.N().S(`
|
||||
|
||||
`)
|
||||
//line web/authorize.qtpl:104
|
||||
//line web/authorize.qtpl:103
|
||||
if p.CodeChallenge != "" {
|
||||
//line web/authorize.qtpl:104
|
||||
//line web/authorize.qtpl:103
|
||||
qw422016.N().S(`
|
||||
<input
|
||||
type="hidden"
|
||||
<input type="hidden"
|
||||
name="code_challenge"
|
||||
value="`)
|
||||
//line web/authorize.qtpl:108
|
||||
//line web/authorize.qtpl:106
|
||||
qw422016.E().S(p.CodeChallenge)
|
||||
//line web/authorize.qtpl:108
|
||||
//line web/authorize.qtpl:106
|
||||
qw422016.N().S(`">
|
||||
|
||||
<input
|
||||
type="hidden"
|
||||
<input type="hidden"
|
||||
name="code_challenge_method"
|
||||
value="`)
|
||||
//line web/authorize.qtpl:113
|
||||
//line web/authorize.qtpl:110
|
||||
qw422016.E().S(p.CodeChallengeMethod.String())
|
||||
//line web/authorize.qtpl:113
|
||||
//line web/authorize.qtpl:110
|
||||
qw422016.N().S(`">
|
||||
`)
|
||||
//line web/authorize.qtpl:114
|
||||
//line web/authorize.qtpl:111
|
||||
}
|
||||
//line web/authorize.qtpl:114
|
||||
//line web/authorize.qtpl:111
|
||||
qw422016.N().S(`
|
||||
|
||||
`)
|
||||
//line web/authorize.qtpl:116
|
||||
//line web/authorize.qtpl:113
|
||||
if p.Me != nil {
|
||||
//line web/authorize.qtpl:116
|
||||
//line web/authorize.qtpl:113
|
||||
qw422016.N().S(`
|
||||
<input
|
||||
type="hidden"
|
||||
<input type="hidden"
|
||||
name="me"
|
||||
value="`)
|
||||
//line web/authorize.qtpl:120
|
||||
//line web/authorize.qtpl:116
|
||||
qw422016.E().S(p.Me.String())
|
||||
//line web/authorize.qtpl:120
|
||||
//line web/authorize.qtpl:116
|
||||
qw422016.N().S(`">
|
||||
`)
|
||||
//line web/authorize.qtpl:121
|
||||
//line web/authorize.qtpl:117
|
||||
}
|
||||
//line web/authorize.qtpl:121
|
||||
//line web/authorize.qtpl:117
|
||||
qw422016.N().S(`
|
||||
|
||||
`)
|
||||
//line web/authorize.qtpl:123
|
||||
//line web/authorize.qtpl:119
|
||||
if len(p.Providers) > 0 {
|
||||
//line web/authorize.qtpl:123
|
||||
//line web/authorize.qtpl:119
|
||||
qw422016.N().S(`
|
||||
<select
|
||||
name="provider"
|
||||
<select name="provider"
|
||||
autocomplete
|
||||
required>
|
||||
|
||||
`)
|
||||
//line web/authorize.qtpl:129
|
||||
//line web/authorize.qtpl:124
|
||||
for _, provider := range p.Providers {
|
||||
//line web/authorize.qtpl:129
|
||||
//line web/authorize.qtpl:124
|
||||
qw422016.N().S(`
|
||||
<option
|
||||
value="`)
|
||||
//line web/authorize.qtpl:131
|
||||
<option value="`)
|
||||
//line web/authorize.qtpl:125
|
||||
qw422016.E().S(provider.UID)
|
||||
//line web/authorize.qtpl:131
|
||||
//line web/authorize.qtpl:125
|
||||
qw422016.N().S(`"
|
||||
`)
|
||||
//line web/authorize.qtpl:132
|
||||
//line web/authorize.qtpl:126
|
||||
if provider.UID == "mastodon" {
|
||||
//line web/authorize.qtpl:132
|
||||
//line web/authorize.qtpl:126
|
||||
qw422016.N().S(`selected`)
|
||||
//line web/authorize.qtpl:132
|
||||
//line web/authorize.qtpl:126
|
||||
}
|
||||
//line web/authorize.qtpl:132
|
||||
//line web/authorize.qtpl:126
|
||||
qw422016.N().S(`>
|
||||
|
||||
`)
|
||||
//line web/authorize.qtpl:134
|
||||
//line web/authorize.qtpl:128
|
||||
qw422016.E().S(provider.Name)
|
||||
//line web/authorize.qtpl:134
|
||||
//line web/authorize.qtpl:128
|
||||
qw422016.N().S(`
|
||||
</option>
|
||||
`)
|
||||
//line web/authorize.qtpl:136
|
||||
//line web/authorize.qtpl:130
|
||||
}
|
||||
//line web/authorize.qtpl:136
|
||||
//line web/authorize.qtpl:130
|
||||
qw422016.N().S(`
|
||||
</select>
|
||||
`)
|
||||
//line web/authorize.qtpl:138
|
||||
//line web/authorize.qtpl:132
|
||||
} else {
|
||||
//line web/authorize.qtpl:138
|
||||
//line web/authorize.qtpl:132
|
||||
qw422016.N().S(`
|
||||
<input type="hidden" name="provider" value="direct">
|
||||
<input type="hidden"
|
||||
name="provider"
|
||||
value="direct">
|
||||
`)
|
||||
//line web/authorize.qtpl:140
|
||||
//line web/authorize.qtpl:136
|
||||
}
|
||||
//line web/authorize.qtpl:140
|
||||
//line web/authorize.qtpl:136
|
||||
qw422016.N().S(`
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
<button type="submit"
|
||||
name="authorize"
|
||||
value="deny">
|
||||
|
||||
`)
|
||||
//line web/authorize.qtpl:147
|
||||
//line web/authorize.qtpl:142
|
||||
p.StreamT(qw422016, "Deny")
|
||||
//line web/authorize.qtpl:147
|
||||
//line web/authorize.qtpl:142
|
||||
qw422016.N().S(`
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
<button type="submit"
|
||||
name="authorize"
|
||||
value="allow">
|
||||
|
||||
`)
|
||||
//line web/authorize.qtpl:155
|
||||
//line web/authorize.qtpl:149
|
||||
p.StreamT(qw422016, "Allow")
|
||||
//line web/authorize.qtpl:155
|
||||
//line web/authorize.qtpl:149
|
||||
qw422016.N().S(`
|
||||
</button>
|
||||
</form>
|
||||
</main>
|
||||
`)
|
||||
//line web/authorize.qtpl:159
|
||||
//line web/authorize.qtpl:153
|
||||
}
|
||||
|
||||
//line web/authorize.qtpl:159
|
||||
//line web/authorize.qtpl:153
|
||||
func (p *AuthorizePage) WriteBody(qq422016 qtio422016.Writer) {
|
||||
//line web/authorize.qtpl:159
|
||||
//line web/authorize.qtpl:153
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line web/authorize.qtpl:159
|
||||
//line web/authorize.qtpl:153
|
||||
p.StreamBody(qw422016)
|
||||
//line web/authorize.qtpl:159
|
||||
//line web/authorize.qtpl:153
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line web/authorize.qtpl:159
|
||||
//line web/authorize.qtpl:153
|
||||
}
|
||||
|
||||
//line web/authorize.qtpl:159
|
||||
//line web/authorize.qtpl:153
|
||||
func (p *AuthorizePage) Body() string {
|
||||
//line web/authorize.qtpl:159
|
||||
//line web/authorize.qtpl:153
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line web/authorize.qtpl:159
|
||||
//line web/authorize.qtpl:153
|
||||
p.WriteBody(qb422016)
|
||||
//line web/authorize.qtpl:159
|
||||
//line web/authorize.qtpl:153
|
||||
qs422016 := string(qb422016.B)
|
||||
//line web/authorize.qtpl:159
|
||||
//line web/authorize.qtpl:153
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line web/authorize.qtpl:159
|
||||
//line web/authorize.qtpl:153
|
||||
return qs422016
|
||||
//line web/authorize.qtpl:159
|
||||
//line web/authorize.qtpl:153
|
||||
}
|
||||
|
|
|
@ -38,22 +38,18 @@
|
|||
|
||||
{% func (p *BaseOf) Head() %}
|
||||
{% comment %}https://evilmartians.com/chronicles/how-to-favicon-in-2021-six-files-that-fit-most-needs{% endcomment %}
|
||||
<link
|
||||
rel="icon"
|
||||
<link rel="icon"
|
||||
href="{%s p.Config.Server.StaticURLPrefix %}/favicon.ico"
|
||||
sizes="any">
|
||||
|
||||
<link
|
||||
rel="icon"
|
||||
<link rel="icon"
|
||||
href="{%s p.Config.Server.StaticURLPrefix %}/icon.svg"
|
||||
type="image/svg+xml">
|
||||
|
||||
<link
|
||||
rel="apple-touch-icon"
|
||||
<link rel="apple-touch-icon"
|
||||
href="{%s p.Config.Server.StaticURLPrefix %}/apple-touch-icon.png">
|
||||
|
||||
<link
|
||||
rel="manifest"
|
||||
<link rel="manifest"
|
||||
href="{%s p.Config.Server.StaticURLPrefix %}/manifest.webmanifest">
|
||||
{% endfunc %}
|
||||
|
||||
|
@ -61,15 +57,12 @@
|
|||
|
||||
{% func Template(p Page) %}
|
||||
<!DOCTYPE html>
|
||||
<html
|
||||
class="page"
|
||||
<html class="page"
|
||||
lang="{%= p.Lang() %}">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1.0">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
{%= p.Head() %}
|
||||
|
||||
|
|
|
@ -153,103 +153,103 @@ func (p *BaseOf) StreamHead(qw422016 *qt422016.Writer) {
|
|||
qw422016.N().S(` `)
|
||||
//line web/baseof.qtpl:40
|
||||
qw422016.N().S(` <link rel="icon" href="`)
|
||||
//line web/baseof.qtpl:43
|
||||
//line web/baseof.qtpl:42
|
||||
qw422016.E().S(p.Config.Server.StaticURLPrefix)
|
||||
//line web/baseof.qtpl:43
|
||||
//line web/baseof.qtpl:42
|
||||
qw422016.N().S(`/favicon.ico" sizes="any"> <link rel="icon" href="`)
|
||||
//line web/baseof.qtpl:48
|
||||
//line web/baseof.qtpl:46
|
||||
qw422016.E().S(p.Config.Server.StaticURLPrefix)
|
||||
//line web/baseof.qtpl:48
|
||||
//line web/baseof.qtpl:46
|
||||
qw422016.N().S(`/icon.svg" type="image/svg+xml"> <link rel="apple-touch-icon" href="`)
|
||||
//line web/baseof.qtpl:53
|
||||
//line web/baseof.qtpl:50
|
||||
qw422016.E().S(p.Config.Server.StaticURLPrefix)
|
||||
//line web/baseof.qtpl:53
|
||||
//line web/baseof.qtpl:50
|
||||
qw422016.N().S(`/apple-touch-icon.png"> <link rel="manifest" href="`)
|
||||
//line web/baseof.qtpl:57
|
||||
//line web/baseof.qtpl:53
|
||||
qw422016.E().S(p.Config.Server.StaticURLPrefix)
|
||||
//line web/baseof.qtpl:57
|
||||
//line web/baseof.qtpl:53
|
||||
qw422016.N().S(`/manifest.webmanifest"> `)
|
||||
//line web/baseof.qtpl:58
|
||||
//line web/baseof.qtpl:54
|
||||
}
|
||||
|
||||
//line web/baseof.qtpl:58
|
||||
//line web/baseof.qtpl:54
|
||||
func (p *BaseOf) WriteHead(qq422016 qtio422016.Writer) {
|
||||
//line web/baseof.qtpl:58
|
||||
//line web/baseof.qtpl:54
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line web/baseof.qtpl:58
|
||||
//line web/baseof.qtpl:54
|
||||
p.StreamHead(qw422016)
|
||||
//line web/baseof.qtpl:58
|
||||
//line web/baseof.qtpl:54
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line web/baseof.qtpl:58
|
||||
//line web/baseof.qtpl:54
|
||||
}
|
||||
|
||||
//line web/baseof.qtpl:58
|
||||
//line web/baseof.qtpl:54
|
||||
func (p *BaseOf) Head() string {
|
||||
//line web/baseof.qtpl:58
|
||||
//line web/baseof.qtpl:54
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line web/baseof.qtpl:58
|
||||
//line web/baseof.qtpl:54
|
||||
p.WriteHead(qb422016)
|
||||
//line web/baseof.qtpl:58
|
||||
//line web/baseof.qtpl:54
|
||||
qs422016 := string(qb422016.B)
|
||||
//line web/baseof.qtpl:58
|
||||
//line web/baseof.qtpl:54
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line web/baseof.qtpl:58
|
||||
//line web/baseof.qtpl:54
|
||||
return qs422016
|
||||
//line web/baseof.qtpl:58
|
||||
//line web/baseof.qtpl:54
|
||||
}
|
||||
|
||||
//line web/baseof.qtpl:60
|
||||
//line web/baseof.qtpl:56
|
||||
func (p *BaseOf) StreamBody(qw422016 *qt422016.Writer) {
|
||||
//line web/baseof.qtpl:60
|
||||
//line web/baseof.qtpl:56
|
||||
}
|
||||
|
||||
//line web/baseof.qtpl:60
|
||||
//line web/baseof.qtpl:56
|
||||
func (p *BaseOf) WriteBody(qq422016 qtio422016.Writer) {
|
||||
//line web/baseof.qtpl:60
|
||||
//line web/baseof.qtpl:56
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line web/baseof.qtpl:60
|
||||
//line web/baseof.qtpl:56
|
||||
p.StreamBody(qw422016)
|
||||
//line web/baseof.qtpl:60
|
||||
//line web/baseof.qtpl:56
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line web/baseof.qtpl:60
|
||||
//line web/baseof.qtpl:56
|
||||
}
|
||||
|
||||
//line web/baseof.qtpl:60
|
||||
//line web/baseof.qtpl:56
|
||||
func (p *BaseOf) Body() string {
|
||||
//line web/baseof.qtpl:60
|
||||
//line web/baseof.qtpl:56
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line web/baseof.qtpl:60
|
||||
//line web/baseof.qtpl:56
|
||||
p.WriteBody(qb422016)
|
||||
//line web/baseof.qtpl:60
|
||||
//line web/baseof.qtpl:56
|
||||
qs422016 := string(qb422016.B)
|
||||
//line web/baseof.qtpl:60
|
||||
//line web/baseof.qtpl:56
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line web/baseof.qtpl:60
|
||||
//line web/baseof.qtpl:56
|
||||
return qs422016
|
||||
//line web/baseof.qtpl:60
|
||||
//line web/baseof.qtpl:56
|
||||
}
|
||||
|
||||
//line web/baseof.qtpl:62
|
||||
//line web/baseof.qtpl:58
|
||||
func StreamTemplate(qw422016 *qt422016.Writer, p Page) {
|
||||
//line web/baseof.qtpl:62
|
||||
//line web/baseof.qtpl:58
|
||||
qw422016.N().S(` <!DOCTYPE html> <html class="page" lang="`)
|
||||
//line web/baseof.qtpl:66
|
||||
//line web/baseof.qtpl:61
|
||||
p.StreamLang(qw422016)
|
||||
//line web/baseof.qtpl:66
|
||||
qw422016.N().S(`"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> `)
|
||||
//line web/baseof.qtpl:74
|
||||
//line web/baseof.qtpl:61
|
||||
qw422016.N().S(`"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> `)
|
||||
//line web/baseof.qtpl:67
|
||||
p.StreamHead(qw422016)
|
||||
//line web/baseof.qtpl:74
|
||||
//line web/baseof.qtpl:67
|
||||
qw422016.N().S(` <title>`)
|
||||
//line web/baseof.qtpl:76
|
||||
//line web/baseof.qtpl:69
|
||||
p.StreamTitle(qw422016)
|
||||
//line web/baseof.qtpl:76
|
||||
//line web/baseof.qtpl:69
|
||||
qw422016.N().S(`</title> </head> <body class="page__body body"> `)
|
||||
//line web/baseof.qtpl:79
|
||||
//line web/baseof.qtpl:72
|
||||
p.StreamBody(qw422016)
|
||||
//line web/baseof.qtpl:79
|
||||
//line web/baseof.qtpl:72
|
||||
qw422016.N().S(` `)
|
||||
//line web/baseof.qtpl:82
|
||||
//line web/baseof.qtpl:75
|
||||
var path, vcsRevision string
|
||||
|
||||
if bi, ok := debug.ReadBuildInfo(); ok {
|
||||
|
@ -264,94 +264,94 @@ func StreamTemplate(qw422016 *qt422016.Writer, p Page) {
|
|||
}
|
||||
}
|
||||
|
||||
//line web/baseof.qtpl:95
|
||||
//line web/baseof.qtpl:88
|
||||
qw422016.N().S(` `)
|
||||
//line web/baseof.qtpl:97
|
||||
//line web/baseof.qtpl:90
|
||||
if vcsRevision != "" {
|
||||
//line web/baseof.qtpl:97
|
||||
//line web/baseof.qtpl:90
|
||||
qw422016.N().S(` <footer> <small> `)
|
||||
//line web/baseof.qtpl:100
|
||||
//line web/baseof.qtpl:93
|
||||
p.StreamT(qw422016, "version")
|
||||
//line web/baseof.qtpl:100
|
||||
//line web/baseof.qtpl:93
|
||||
qw422016.N().S(` <a href="https://`)
|
||||
//line web/baseof.qtpl:101
|
||||
//line web/baseof.qtpl:94
|
||||
qw422016.E().S(path)
|
||||
//line web/baseof.qtpl:101
|
||||
//line web/baseof.qtpl:94
|
||||
qw422016.N().S(`/commit/`)
|
||||
//line web/baseof.qtpl:101
|
||||
//line web/baseof.qtpl:94
|
||||
qw422016.E().S(vcsRevision)
|
||||
//line web/baseof.qtpl:101
|
||||
//line web/baseof.qtpl:94
|
||||
qw422016.N().S(`" target="_blank"> `)
|
||||
//line web/baseof.qtpl:102
|
||||
//line web/baseof.qtpl:95
|
||||
qw422016.E().S(vcsRevision[:7])
|
||||
//line web/baseof.qtpl:102
|
||||
//line web/baseof.qtpl:95
|
||||
qw422016.N().S(`</a> </small> </footer> `)
|
||||
//line web/baseof.qtpl:106
|
||||
//line web/baseof.qtpl:99
|
||||
}
|
||||
//line web/baseof.qtpl:106
|
||||
//line web/baseof.qtpl:99
|
||||
qw422016.N().S(` </body> </html> `)
|
||||
//line web/baseof.qtpl:109
|
||||
//line web/baseof.qtpl:102
|
||||
}
|
||||
|
||||
//line web/baseof.qtpl:109
|
||||
//line web/baseof.qtpl:102
|
||||
func WriteTemplate(qq422016 qtio422016.Writer, p Page) {
|
||||
//line web/baseof.qtpl:109
|
||||
//line web/baseof.qtpl:102
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line web/baseof.qtpl:109
|
||||
//line web/baseof.qtpl:102
|
||||
StreamTemplate(qw422016, p)
|
||||
//line web/baseof.qtpl:109
|
||||
//line web/baseof.qtpl:102
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line web/baseof.qtpl:109
|
||||
//line web/baseof.qtpl:102
|
||||
}
|
||||
|
||||
//line web/baseof.qtpl:109
|
||||
//line web/baseof.qtpl:102
|
||||
func Template(p Page) string {
|
||||
//line web/baseof.qtpl:109
|
||||
//line web/baseof.qtpl:102
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line web/baseof.qtpl:109
|
||||
//line web/baseof.qtpl:102
|
||||
WriteTemplate(qb422016, p)
|
||||
//line web/baseof.qtpl:109
|
||||
//line web/baseof.qtpl:102
|
||||
qs422016 := string(qb422016.B)
|
||||
//line web/baseof.qtpl:109
|
||||
//line web/baseof.qtpl:102
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line web/baseof.qtpl:109
|
||||
//line web/baseof.qtpl:102
|
||||
return qs422016
|
||||
//line web/baseof.qtpl:109
|
||||
//line web/baseof.qtpl:102
|
||||
}
|
||||
|
||||
//line web/baseof.qtpl:111
|
||||
//line web/baseof.qtpl:104
|
||||
func (p *BaseOf) StreamT(qw422016 *qt422016.Writer, format string, args ...interface{}) {
|
||||
//line web/baseof.qtpl:111
|
||||
//line web/baseof.qtpl:104
|
||||
qw422016.N().S(` `)
|
||||
//line web/baseof.qtpl:112
|
||||
//line web/baseof.qtpl:105
|
||||
qw422016.E().S(p.Printer.Sprintf(format, args...))
|
||||
//line web/baseof.qtpl:112
|
||||
//line web/baseof.qtpl:105
|
||||
qw422016.N().S(` `)
|
||||
//line web/baseof.qtpl:113
|
||||
//line web/baseof.qtpl:106
|
||||
}
|
||||
|
||||
//line web/baseof.qtpl:113
|
||||
//line web/baseof.qtpl:106
|
||||
func (p *BaseOf) WriteT(qq422016 qtio422016.Writer, format string, args ...interface{}) {
|
||||
//line web/baseof.qtpl:113
|
||||
//line web/baseof.qtpl:106
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line web/baseof.qtpl:113
|
||||
//line web/baseof.qtpl:106
|
||||
p.StreamT(qw422016, format, args...)
|
||||
//line web/baseof.qtpl:113
|
||||
//line web/baseof.qtpl:106
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line web/baseof.qtpl:113
|
||||
//line web/baseof.qtpl:106
|
||||
}
|
||||
|
||||
//line web/baseof.qtpl:113
|
||||
//line web/baseof.qtpl:106
|
||||
func (p *BaseOf) T(format string, args ...interface{}) string {
|
||||
//line web/baseof.qtpl:113
|
||||
//line web/baseof.qtpl:106
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line web/baseof.qtpl:113
|
||||
//line web/baseof.qtpl:106
|
||||
p.WriteT(qb422016, format, args...)
|
||||
//line web/baseof.qtpl:113
|
||||
//line web/baseof.qtpl:106
|
||||
qs422016 := string(qb422016.B)
|
||||
//line web/baseof.qtpl:113
|
||||
//line web/baseof.qtpl:106
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line web/baseof.qtpl:113
|
||||
//line web/baseof.qtpl:106
|
||||
return qs422016
|
||||
//line web/baseof.qtpl:113
|
||||
//line web/baseof.qtpl:106
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
{% import "source.toby3d.me/toby3d/auth/internal/domain" %}
|
||||
{% import (
|
||||
"source.toby3d.me/toby3d/auth/internal/domain"
|
||||
) %}
|
||||
|
||||
{% code type CallbackPage struct {
|
||||
BaseOf
|
||||
|
|
|
@ -5,72 +5,74 @@
|
|||
package web
|
||||
|
||||
//line web/callback.qtpl:1
|
||||
import "source.toby3d.me/toby3d/auth/internal/domain"
|
||||
import (
|
||||
"source.toby3d.me/toby3d/auth/internal/domain"
|
||||
)
|
||||
|
||||
//line web/callback.qtpl:3
|
||||
//line web/callback.qtpl:5
|
||||
import (
|
||||
qtio422016 "io"
|
||||
|
||||
qt422016 "github.com/valyala/quicktemplate"
|
||||
)
|
||||
|
||||
//line web/callback.qtpl:3
|
||||
//line web/callback.qtpl:5
|
||||
var (
|
||||
_ = qtio422016.Copy
|
||||
_ = qt422016.AcquireByteBuffer
|
||||
)
|
||||
|
||||
//line web/callback.qtpl:3
|
||||
//line web/callback.qtpl:5
|
||||
type CallbackPage struct {
|
||||
BaseOf
|
||||
Token *domain.Token
|
||||
}
|
||||
|
||||
//line web/callback.qtpl:9
|
||||
//line web/callback.qtpl:11
|
||||
func (p *CallbackPage) StreamBody(qw422016 *qt422016.Writer) {
|
||||
//line web/callback.qtpl:9
|
||||
//line web/callback.qtpl:11
|
||||
qw422016.N().S(` `)
|
||||
//line web/callback.qtpl:10
|
||||
//line web/callback.qtpl:12
|
||||
if p.Token != nil {
|
||||
//line web/callback.qtpl:10
|
||||
//line web/callback.qtpl:12
|
||||
qw422016.N().S(` <h1>`)
|
||||
//line web/callback.qtpl:11
|
||||
//line web/callback.qtpl:13
|
||||
qw422016.E().S(p.Token.Me.String())
|
||||
//line web/callback.qtpl:11
|
||||
//line web/callback.qtpl:13
|
||||
qw422016.N().S(`</h1> <small>`)
|
||||
//line web/callback.qtpl:12
|
||||
//line web/callback.qtpl:14
|
||||
qw422016.E().S(p.Token.AccessToken)
|
||||
//line web/callback.qtpl:12
|
||||
//line web/callback.qtpl:14
|
||||
qw422016.N().S(`</small> `)
|
||||
//line web/callback.qtpl:13
|
||||
//line web/callback.qtpl:15
|
||||
}
|
||||
//line web/callback.qtpl:13
|
||||
//line web/callback.qtpl:15
|
||||
qw422016.N().S(` `)
|
||||
//line web/callback.qtpl:14
|
||||
//line web/callback.qtpl:16
|
||||
}
|
||||
|
||||
//line web/callback.qtpl:14
|
||||
//line web/callback.qtpl:16
|
||||
func (p *CallbackPage) WriteBody(qq422016 qtio422016.Writer) {
|
||||
//line web/callback.qtpl:14
|
||||
//line web/callback.qtpl:16
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line web/callback.qtpl:14
|
||||
//line web/callback.qtpl:16
|
||||
p.StreamBody(qw422016)
|
||||
//line web/callback.qtpl:14
|
||||
//line web/callback.qtpl:16
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line web/callback.qtpl:14
|
||||
//line web/callback.qtpl:16
|
||||
}
|
||||
|
||||
//line web/callback.qtpl:14
|
||||
//line web/callback.qtpl:16
|
||||
func (p *CallbackPage) Body() string {
|
||||
//line web/callback.qtpl:14
|
||||
//line web/callback.qtpl:16
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line web/callback.qtpl:14
|
||||
//line web/callback.qtpl:16
|
||||
p.WriteBody(qb422016)
|
||||
//line web/callback.qtpl:14
|
||||
//line web/callback.qtpl:16
|
||||
qs422016 := string(qb422016.B)
|
||||
//line web/callback.qtpl:14
|
||||
//line web/callback.qtpl:16
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line web/callback.qtpl:14
|
||||
//line web/callback.qtpl:16
|
||||
return qs422016
|
||||
//line web/callback.qtpl:14
|
||||
//line web/callback.qtpl:16
|
||||
}
|
||||
|
|
|
@ -25,8 +25,7 @@
|
|||
{% endif %}
|
||||
|
||||
{% if err.URI != "" %}
|
||||
<a
|
||||
rel="noreferrer noopener"
|
||||
<a rel="noreferrer noopener"
|
||||
href="{%s err.URI %}"
|
||||
target="_blank">
|
||||
|
||||
|
|
|
@ -100,59 +100,59 @@ func (p *ErrorPage) StreamBody(qw422016 *qt422016.Writer) {
|
|||
if err.URI != "" {
|
||||
//line web/error.qtpl:27
|
||||
qw422016.N().S(` <a rel="noreferrer noopener" href="`)
|
||||
//line web/error.qtpl:30
|
||||
//line web/error.qtpl:29
|
||||
qw422016.E().S(err.URI)
|
||||
//line web/error.qtpl:30
|
||||
//line web/error.qtpl:29
|
||||
qw422016.N().S(`" target="_blank"> `)
|
||||
//line web/error.qtpl:33
|
||||
//line web/error.qtpl:32
|
||||
qw422016.E().S(p.T("How do I fix it?"))
|
||||
//line web/error.qtpl:33
|
||||
//line web/error.qtpl:32
|
||||
qw422016.N().S(` </a> `)
|
||||
//line web/error.qtpl:35
|
||||
//line web/error.qtpl:34
|
||||
}
|
||||
//line web/error.qtpl:35
|
||||
//line web/error.qtpl:34
|
||||
qw422016.N().S(` `)
|
||||
//line web/error.qtpl:36
|
||||
//line web/error.qtpl:35
|
||||
} else {
|
||||
//line web/error.qtpl:36
|
||||
//line web/error.qtpl:35
|
||||
qw422016.N().S(` <h1>`)
|
||||
//line web/error.qtpl:37
|
||||
//line web/error.qtpl:36
|
||||
qw422016.E().S(p.T("Error"))
|
||||
//line web/error.qtpl:37
|
||||
//line web/error.qtpl:36
|
||||
qw422016.N().S(`</h1> <p>`)
|
||||
//line web/error.qtpl:38
|
||||
//line web/error.qtpl:37
|
||||
qw422016.E().S(p.Error.Error())
|
||||
//line web/error.qtpl:38
|
||||
//line web/error.qtpl:37
|
||||
qw422016.N().S(`</p> `)
|
||||
//line web/error.qtpl:39
|
||||
//line web/error.qtpl:38
|
||||
}
|
||||
//line web/error.qtpl:39
|
||||
//line web/error.qtpl:38
|
||||
qw422016.N().S(` </main> `)
|
||||
//line web/error.qtpl:41
|
||||
//line web/error.qtpl:40
|
||||
}
|
||||
|
||||
//line web/error.qtpl:41
|
||||
//line web/error.qtpl:40
|
||||
func (p *ErrorPage) WriteBody(qq422016 qtio422016.Writer) {
|
||||
//line web/error.qtpl:41
|
||||
//line web/error.qtpl:40
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line web/error.qtpl:41
|
||||
//line web/error.qtpl:40
|
||||
p.StreamBody(qw422016)
|
||||
//line web/error.qtpl:41
|
||||
//line web/error.qtpl:40
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line web/error.qtpl:41
|
||||
//line web/error.qtpl:40
|
||||
}
|
||||
|
||||
//line web/error.qtpl:41
|
||||
//line web/error.qtpl:40
|
||||
func (p *ErrorPage) Body() string {
|
||||
//line web/error.qtpl:41
|
||||
//line web/error.qtpl:40
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line web/error.qtpl:41
|
||||
//line web/error.qtpl:40
|
||||
p.WriteBody(qb422016)
|
||||
//line web/error.qtpl:41
|
||||
//line web/error.qtpl:40
|
||||
qs422016 := string(qb422016.B)
|
||||
//line web/error.qtpl:41
|
||||
//line web/error.qtpl:40
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line web/error.qtpl:41
|
||||
//line web/error.qtpl:40
|
||||
return qs422016
|
||||
//line web/error.qtpl:41
|
||||
//line web/error.qtpl:40
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
{% import "source.toby3d.me/toby3d/auth/internal/domain" %}
|
||||
{% import (
|
||||
"source.toby3d.me/toby3d/auth/internal/domain"
|
||||
) %}
|
||||
|
||||
{% code type HomePage struct {
|
||||
BaseOf
|
||||
|
@ -16,8 +18,7 @@
|
|||
|
||||
{% func (p *HomePage) Body() %}
|
||||
<header class="h-app h-x-app">
|
||||
<img
|
||||
class="u-logo"
|
||||
<img class="u-logo"
|
||||
src="{%s p.Client.GetLogo().String() %}"
|
||||
alt="{%s p.Client.GetName() %}"
|
||||
crossorigin="anonymous"
|
||||
|
@ -28,8 +29,7 @@
|
|||
width="140">
|
||||
|
||||
<h1>
|
||||
<a
|
||||
class="p-name u-url"
|
||||
<a class="p-name u-url"
|
||||
href="{%s p.Client.GetURL().String() %}">
|
||||
|
||||
{%s p.Client.GetName() %}
|
||||
|
@ -38,37 +38,34 @@
|
|||
</header>
|
||||
|
||||
<main>
|
||||
<form
|
||||
<form class=""
|
||||
method="get"
|
||||
action="/authorize"
|
||||
enctype="application/x-www-form-urlencoded"
|
||||
accept-charset="utf-8"
|
||||
target="_self">
|
||||
|
||||
{% for name, value := range map[string]string {
|
||||
{% 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,
|
||||
} %}
|
||||
<input
|
||||
type="hidden"
|
||||
<input type="hidden"
|
||||
name="{%s name %}"
|
||||
value="{%s value %}">
|
||||
{% endfor %}
|
||||
|
||||
{% for _, scope := domain.Scopes{
|
||||
domain.ScopeProfile,
|
||||
{% for _, scope := range []domain.Scope{
|
||||
domain.ScopeEmail,
|
||||
domain.ScopeProfile,
|
||||
} %}
|
||||
<input
|
||||
type="hidden"
|
||||
<input type="hidden"
|
||||
name="scope[]"
|
||||
value="{%s scope.String() %}">
|
||||
{% endfor %}
|
||||
|
||||
<input
|
||||
type="url"
|
||||
<input type="url"
|
||||
name="me"
|
||||
placeholder="https://example.com/"
|
||||
inputmode="url"
|
||||
|
|
128
web/home.qtpl.go
128
web/home.qtpl.go
|
@ -5,88 +5,90 @@
|
|||
package web
|
||||
|
||||
//line web/home.qtpl:1
|
||||
import "source.toby3d.me/toby3d/auth/internal/domain"
|
||||
import (
|
||||
"source.toby3d.me/toby3d/auth/internal/domain"
|
||||
)
|
||||
|
||||
//line web/home.qtpl:3
|
||||
//line web/home.qtpl:5
|
||||
import (
|
||||
qtio422016 "io"
|
||||
|
||||
qt422016 "github.com/valyala/quicktemplate"
|
||||
)
|
||||
|
||||
//line web/home.qtpl:3
|
||||
//line web/home.qtpl:5
|
||||
var (
|
||||
_ = qtio422016.Copy
|
||||
_ = qt422016.AcquireByteBuffer
|
||||
)
|
||||
|
||||
//line web/home.qtpl:3
|
||||
//line web/home.qtpl:5
|
||||
type HomePage struct {
|
||||
BaseOf
|
||||
Client *domain.Client
|
||||
State string
|
||||
}
|
||||
|
||||
//line web/home.qtpl:10
|
||||
//line web/home.qtpl:12
|
||||
func (p *HomePage) StreamHead(qw422016 *qt422016.Writer) {
|
||||
//line web/home.qtpl:10
|
||||
//line web/home.qtpl:12
|
||||
qw422016.N().S(` `)
|
||||
//line web/home.qtpl:11
|
||||
//line web/home.qtpl:13
|
||||
p.BaseOf.StreamHead(qw422016)
|
||||
//line web/home.qtpl:11
|
||||
//line web/home.qtpl:13
|
||||
qw422016.N().S(` `)
|
||||
//line web/home.qtpl:12
|
||||
//line web/home.qtpl:14
|
||||
for i := range p.Client.RedirectURI {
|
||||
//line web/home.qtpl:12
|
||||
//line web/home.qtpl:14
|
||||
qw422016.N().S(` <link rel="redirect_uri" href="`)
|
||||
//line web/home.qtpl:13
|
||||
//line web/home.qtpl:15
|
||||
qw422016.E().S(p.Client.RedirectURI[i].String())
|
||||
//line web/home.qtpl:13
|
||||
//line web/home.qtpl:15
|
||||
qw422016.N().S(`"> `)
|
||||
//line web/home.qtpl:14
|
||||
//line web/home.qtpl:16
|
||||
}
|
||||
//line web/home.qtpl:14
|
||||
//line web/home.qtpl:16
|
||||
qw422016.N().S(` `)
|
||||
//line web/home.qtpl:15
|
||||
//line web/home.qtpl:17
|
||||
}
|
||||
|
||||
//line web/home.qtpl:15
|
||||
//line web/home.qtpl:17
|
||||
func (p *HomePage) WriteHead(qq422016 qtio422016.Writer) {
|
||||
//line web/home.qtpl:15
|
||||
//line web/home.qtpl:17
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line web/home.qtpl:15
|
||||
//line web/home.qtpl:17
|
||||
p.StreamHead(qw422016)
|
||||
//line web/home.qtpl:15
|
||||
//line web/home.qtpl:17
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line web/home.qtpl:15
|
||||
//line web/home.qtpl:17
|
||||
}
|
||||
|
||||
//line web/home.qtpl:15
|
||||
//line web/home.qtpl:17
|
||||
func (p *HomePage) Head() string {
|
||||
//line web/home.qtpl:15
|
||||
//line web/home.qtpl:17
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line web/home.qtpl:15
|
||||
//line web/home.qtpl:17
|
||||
p.WriteHead(qb422016)
|
||||
//line web/home.qtpl:15
|
||||
//line web/home.qtpl:17
|
||||
qs422016 := string(qb422016.B)
|
||||
//line web/home.qtpl:15
|
||||
//line web/home.qtpl:17
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line web/home.qtpl:15
|
||||
//line web/home.qtpl:17
|
||||
return qs422016
|
||||
//line web/home.qtpl:15
|
||||
//line web/home.qtpl:17
|
||||
}
|
||||
|
||||
//line web/home.qtpl:17
|
||||
//line web/home.qtpl:19
|
||||
func (p *HomePage) StreamBody(qw422016 *qt422016.Writer) {
|
||||
//line web/home.qtpl:17
|
||||
//line web/home.qtpl:19
|
||||
qw422016.N().S(` <header class="h-app h-x-app"> <img class="u-logo" src="`)
|
||||
//line web/home.qtpl:21
|
||||
//line web/home.qtpl:22
|
||||
qw422016.E().S(p.Client.GetLogo().String())
|
||||
//line web/home.qtpl:21
|
||||
//line web/home.qtpl:22
|
||||
qw422016.N().S(`" alt="`)
|
||||
//line web/home.qtpl:22
|
||||
//line web/home.qtpl:23
|
||||
qw422016.E().S(p.Client.GetName())
|
||||
//line web/home.qtpl:22
|
||||
//line web/home.qtpl:23
|
||||
qw422016.N().S(`" crossorigin="anonymous" decoding="async" height="140" importance="high" referrerpolicy="no-referrer-when-downgrade" width="140"> <h1> <a class="p-name u-url" href="`)
|
||||
//line web/home.qtpl:33
|
||||
qw422016.E().S(p.Client.GetURL().String())
|
||||
|
@ -95,58 +97,72 @@ func (p *HomePage) StreamBody(qw422016 *qt422016.Writer) {
|
|||
//line web/home.qtpl:35
|
||||
qw422016.E().S(p.Client.GetName())
|
||||
//line web/home.qtpl:35
|
||||
qw422016.N().S(` </a> </h1> </header> <main> <form method="get" action="/authorize" enctype="application/x-www-form-urlencoded" accept-charset="utf-8" target="_self"> `)
|
||||
qw422016.N().S(` </a> </h1> </header> <main> <form class="" method="get" action="/authorize" enctype="application/x-www-form-urlencoded" accept-charset="utf-8" target="_self"> `)
|
||||
//line web/home.qtpl:48
|
||||
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(),
|
||||
} {
|
||||
//line web/home.qtpl:54
|
||||
//line web/home.qtpl:53
|
||||
qw422016.N().S(` <input type="hidden" name="`)
|
||||
//line web/home.qtpl:57
|
||||
//line web/home.qtpl:55
|
||||
qw422016.E().S(name)
|
||||
//line web/home.qtpl:57
|
||||
//line web/home.qtpl:55
|
||||
qw422016.N().S(`" value="`)
|
||||
//line web/home.qtpl:58
|
||||
//line web/home.qtpl:56
|
||||
qw422016.E().S(value)
|
||||
//line web/home.qtpl:58
|
||||
//line web/home.qtpl:56
|
||||
qw422016.N().S(`"> `)
|
||||
//line web/home.qtpl:59
|
||||
//line web/home.qtpl:57
|
||||
}
|
||||
//line web/home.qtpl:57
|
||||
qw422016.N().S(` `)
|
||||
//line web/home.qtpl:59
|
||||
for _, scope := range []domain.Scope{
|
||||
domain.ScopeEmail,
|
||||
domain.ScopeProfile,
|
||||
} {
|
||||
//line web/home.qtpl:62
|
||||
qw422016.N().S(` <input type="hidden" name="scope[]" value="`)
|
||||
//line web/home.qtpl:65
|
||||
qw422016.E().S(scope.String())
|
||||
//line web/home.qtpl:65
|
||||
qw422016.N().S(`"> `)
|
||||
//line web/home.qtpl:66
|
||||
}
|
||||
//line web/home.qtpl:66
|
||||
qw422016.N().S(` <input type="url" name="me" placeholder="https://example.com/" inputmode="url" autocomplete="url" required> <button type="submit">`)
|
||||
//line web/home.qtpl:69
|
||||
//line web/home.qtpl:75
|
||||
p.StreamT(qw422016, "Sign In")
|
||||
//line web/home.qtpl:69
|
||||
//line web/home.qtpl:75
|
||||