363 lines
8.0 KiB
Go
363 lines
8.0 KiB
Go
// Code generated by qtc from "authorize.qtpl". DO NOT EDIT.
|
|
// See https://github.com/valyala/quicktemplate for details.
|
|
|
|
//line web/authorize.qtpl:1
|
|
package web
|
|
|
|
//line web/authorize.qtpl:1
|
|
import "source.toby3d.me/website/indieauth/internal/domain"
|
|
|
|
//line web/authorize.qtpl:3
|
|
import (
|
|
qtio422016 "io"
|
|
|
|
qt422016 "github.com/valyala/quicktemplate"
|
|
)
|
|
|
|
//line web/authorize.qtpl:3
|
|
var (
|
|
_ = qtio422016.Copy
|
|
_ = qt422016.AcquireByteBuffer
|
|
)
|
|
|
|
//line web/authorize.qtpl:3
|
|
type AuthPage struct {
|
|
BaseOf
|
|
Client *domain.Client
|
|
Me *domain.Me
|
|
RedirectURI *domain.URL
|
|
CodeChallengeMethod domain.CodeChallengeMethod
|
|
ResponseType domain.ResponseType
|
|
Scope domain.Scopes
|
|
CodeChallenge string
|
|
CSRF string
|
|
State string
|
|
}
|
|
|
|
//line web/authorize.qtpl:16
|
|
func (p *AuthPage) StreamLang(qw422016 *qt422016.Writer) {
|
|
//line web/authorize.qtpl:16
|
|
qw422016.N().S(`
|
|
en
|
|
`)
|
|
//line web/authorize.qtpl:18
|
|
}
|
|
|
|
//line web/authorize.qtpl:18
|
|
func (p *AuthPage) WriteLang(qq422016 qtio422016.Writer) {
|
|
//line web/authorize.qtpl:18
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line web/authorize.qtpl:18
|
|
p.StreamLang(qw422016)
|
|
//line web/authorize.qtpl:18
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line web/authorize.qtpl:18
|
|
}
|
|
|
|
//line web/authorize.qtpl:18
|
|
func (p *AuthPage) Lang() string {
|
|
//line web/authorize.qtpl:18
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line web/authorize.qtpl:18
|
|
p.WriteLang(qb422016)
|
|
//line web/authorize.qtpl:18
|
|
qs422016 := string(qb422016.B)
|
|
//line web/authorize.qtpl:18
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line web/authorize.qtpl:18
|
|
return qs422016
|
|
//line web/authorize.qtpl:18
|
|
}
|
|
|
|
//line web/authorize.qtpl:20
|
|
func (p *AuthPage) StreamTitle(qw422016 *qt422016.Writer) {
|
|
//line web/authorize.qtpl:20
|
|
qw422016.N().S(`
|
|
Authorize `)
|
|
//line web/authorize.qtpl:21
|
|
qw422016.E().S(p.Client.Name[0])
|
|
//line web/authorize.qtpl:21
|
|
qw422016.N().S(`
|
|
`)
|
|
//line web/authorize.qtpl:22
|
|
}
|
|
|
|
//line web/authorize.qtpl:22
|
|
func (p *AuthPage) WriteTitle(qq422016 qtio422016.Writer) {
|
|
//line web/authorize.qtpl:22
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line web/authorize.qtpl:22
|
|
p.StreamTitle(qw422016)
|
|
//line web/authorize.qtpl:22
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line web/authorize.qtpl:22
|
|
}
|
|
|
|
//line web/authorize.qtpl:22
|
|
func (p *AuthPage) Title() string {
|
|
//line web/authorize.qtpl:22
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line web/authorize.qtpl:22
|
|
p.WriteTitle(qb422016)
|
|
//line web/authorize.qtpl:22
|
|
qs422016 := string(qb422016.B)
|
|
//line web/authorize.qtpl:22
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line web/authorize.qtpl:22
|
|
return qs422016
|
|
//line web/authorize.qtpl:22
|
|
}
|
|
|
|
//line web/authorize.qtpl:24
|
|
func (p *AuthPage) StreamHead(qw422016 *qt422016.Writer) {
|
|
//line web/authorize.qtpl:24
|
|
qw422016.N().S(`
|
|
`)
|
|
//line web/authorize.qtpl:25
|
|
}
|
|
|
|
//line web/authorize.qtpl:25
|
|
func (p *AuthPage) WriteHead(qq422016 qtio422016.Writer) {
|
|
//line web/authorize.qtpl:25
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line web/authorize.qtpl:25
|
|
p.StreamHead(qw422016)
|
|
//line web/authorize.qtpl:25
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line web/authorize.qtpl:25
|
|
}
|
|
|
|
//line web/authorize.qtpl:25
|
|
func (p *AuthPage) Head() string {
|
|
//line web/authorize.qtpl:25
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line web/authorize.qtpl:25
|
|
p.WriteHead(qb422016)
|
|
//line web/authorize.qtpl:25
|
|
qs422016 := string(qb422016.B)
|
|
//line web/authorize.qtpl:25
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line web/authorize.qtpl:25
|
|
return qs422016
|
|
//line web/authorize.qtpl:25
|
|
}
|
|
|
|
//line web/authorize.qtpl:27
|
|
func (p *AuthPage) StreamBody(qw422016 *qt422016.Writer) {
|
|
//line web/authorize.qtpl:27
|
|
qw422016.N().S(`
|
|
`)
|
|
//line web/authorize.qtpl:28
|
|
if p.Client.Logo[0] != nil {
|
|
//line web/authorize.qtpl:28
|
|
qw422016.N().S(`
|
|
<img
|
|
alt="`)
|
|
//line web/authorize.qtpl:30
|
|
qw422016.E().S(p.Client.Name[0])
|
|
//line web/authorize.qtpl:30
|
|
qw422016.N().S(`"
|
|
crossorigin="anonymous"
|
|
decoding="async"
|
|
height="140"
|
|
importance="high"
|
|
loading="lazy"
|
|
referrerpolicy="no-referrer-when-downgrade"
|
|
src="`)
|
|
//line web/authorize.qtpl:37
|
|
qw422016.E().S(p.Client.Logo[0].String())
|
|
//line web/authorize.qtpl:37
|
|
qw422016.N().S(`"
|
|
width="140">
|
|
`)
|
|
//line web/authorize.qtpl:39
|
|
}
|
|
//line web/authorize.qtpl:39
|
|
qw422016.N().S(`
|
|
|
|
<h2>`)
|
|
//line web/authorize.qtpl:41
|
|
qw422016.E().S(p.Client.Name[0])
|
|
//line web/authorize.qtpl:41
|
|
qw422016.N().S(`</h2>
|
|
|
|
<form
|
|
accept-charset="utf-8"
|
|
action="/api/authorize"
|
|
autocomplete="off"
|
|
enctype="application/x-www-form-urlencoded"
|
|
method="post"
|
|
novalidate="true"
|
|
target="_self">
|
|
|
|
`)
|
|
//line web/authorize.qtpl:52
|
|
if p.CSRF != "" {
|
|
//line web/authorize.qtpl:52
|
|
qw422016.N().S(`
|
|
<input
|
|
name="_csrf"
|
|
type="hidden"
|
|
value="`)
|
|
//line web/authorize.qtpl:56
|
|
qw422016.E().S(p.CSRF)
|
|
//line web/authorize.qtpl:56
|
|
qw422016.N().S(`">
|
|
`)
|
|
//line web/authorize.qtpl:57
|
|
}
|
|
//line web/authorize.qtpl:57
|
|
qw422016.N().S(`
|
|
|
|
<input
|
|
name="response_type"
|
|
type="hidden"
|
|
value="code">
|
|
|
|
<input
|
|
name="client_id"
|
|
type="hidden"
|
|
value="`)
|
|
//line web/authorize.qtpl:67
|
|
qw422016.E().S(p.Client.URL[0].String())
|
|
//line web/authorize.qtpl:67
|
|
qw422016.N().S(`">
|
|
|
|
<input
|
|
name="redirect_uri"
|
|
type="hidden"
|
|
value="`)
|
|
//line web/authorize.qtpl:72
|
|
qw422016.E().S(p.RedirectURI.String())
|
|
//line web/authorize.qtpl:72
|
|
qw422016.N().S(`">
|
|
|
|
<input
|
|
name="state"
|
|
type="hidden"
|
|
value="`)
|
|
//line web/authorize.qtpl:77
|
|
qw422016.E().S(p.State)
|
|
//line web/authorize.qtpl:77
|
|
qw422016.N().S(`">
|
|
|
|
`)
|
|
//line web/authorize.qtpl:79
|
|
if p.CodeChallenge != "" {
|
|
//line web/authorize.qtpl:79
|
|
qw422016.N().S(`
|
|
<input
|
|
name="code_challenge"
|
|
type="hidden"
|
|
value="`)
|
|
//line web/authorize.qtpl:83
|
|
qw422016.E().S(p.CodeChallenge)
|
|
//line web/authorize.qtpl:83
|
|
qw422016.N().S(`">
|
|
|
|
<input
|
|
name="code_challenge_method"
|
|
type="hidden"
|
|
value="`)
|
|
//line web/authorize.qtpl:88
|
|
qw422016.E().S(p.CodeChallengeMethod.String())
|
|
//line web/authorize.qtpl:88
|
|
qw422016.N().S(`">
|
|
`)
|
|
//line web/authorize.qtpl:89
|
|
}
|
|
//line web/authorize.qtpl:89
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
//line web/authorize.qtpl:91
|
|
if len(p.Scope) != 0 {
|
|
//line web/authorize.qtpl:91
|
|
qw422016.N().S(`
|
|
<input
|
|
name="scope"
|
|
type="hidden"
|
|
value="`)
|
|
//line web/authorize.qtpl:95
|
|
qw422016.E().S(p.Scope.String())
|
|
//line web/authorize.qtpl:95
|
|
qw422016.N().S(`">
|
|
`)
|
|
//line web/authorize.qtpl:96
|
|
}
|
|
//line web/authorize.qtpl:96
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
//line web/authorize.qtpl:98
|
|
if p.Me != nil {
|
|
//line web/authorize.qtpl:98
|
|
qw422016.N().S(`
|
|
<input
|
|
name="me"
|
|
type="hidden"
|
|
value="`)
|
|
//line web/authorize.qtpl:102
|
|
qw422016.E().S(p.Me.String())
|
|
//line web/authorize.qtpl:102
|
|
qw422016.N().S(`">
|
|
`)
|
|
//line web/authorize.qtpl:103
|
|
}
|
|
//line web/authorize.qtpl:103
|
|
qw422016.N().S(`
|
|
|
|
<button
|
|
name="authorize"
|
|
type="submit"
|
|
value="deny">
|
|
|
|
`)
|
|
//line web/authorize.qtpl:110
|
|
p.StreamT(qw422016, "Deny")
|
|
//line web/authorize.qtpl:110
|
|
qw422016.N().S(`
|
|
</button>
|
|
|
|
<button
|
|
name="authorize"
|
|
type="submit"
|
|
value="allow">
|
|
|
|
`)
|
|
//line web/authorize.qtpl:118
|
|
p.StreamT(qw422016, "Allow")
|
|
//line web/authorize.qtpl:118
|
|
qw422016.N().S(`
|
|
</button>
|
|
</form>
|
|
`)
|
|
//line web/authorize.qtpl:121
|
|
}
|
|
|
|
//line web/authorize.qtpl:121
|
|
func (p *AuthPage) WriteBody(qq422016 qtio422016.Writer) {
|
|
//line web/authorize.qtpl:121
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line web/authorize.qtpl:121
|
|
p.StreamBody(qw422016)
|
|
//line web/authorize.qtpl:121
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line web/authorize.qtpl:121
|
|
}
|
|
|
|
//line web/authorize.qtpl:121
|
|
func (p *AuthPage) Body() string {
|
|
//line web/authorize.qtpl:121
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line web/authorize.qtpl:121
|
|
p.WriteBody(qb422016)
|
|
//line web/authorize.qtpl:121
|
|
qs422016 := string(qb422016.B)
|
|
//line web/authorize.qtpl:121
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line web/authorize.qtpl:121
|
|
return qs422016
|
|
//line web/authorize.qtpl:121
|
|
}
|