auth/web/auth.qtpl.go

352 lines
7.8 KiB
Go

// Code generated by qtc from "auth.qtpl". DO NOT EDIT.
// See https://github.com/valyala/quicktemplate for details.
//line ../../web/auth.qtpl:1
package web
//line ../../web/auth.qtpl:1
import "gitlab.com/toby3d/indieauth/internal/model"
//line ../../web/auth.qtpl:3
import (
qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate"
)
//line ../../web/auth.qtpl:3
var (
_ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer
)
//line ../../web/auth.qtpl:4
type AuthPage struct {
Client *model.Client
CodeChallenge string
CodeChallengeMethod string
CSRF []byte
Me string
RedirectURI string
ResponseType string
Scope string
State []byte
}
//line ../../web/auth.qtpl:17
func (p *AuthPage) StreamLang(qw422016 *qt422016.Writer) {
//line ../../web/auth.qtpl:17
qw422016.N().S(`
en
`)
//line ../../web/auth.qtpl:19
}
//line ../../web/auth.qtpl:19
func (p *AuthPage) WriteLang(qq422016 qtio422016.Writer) {
//line ../../web/auth.qtpl:19
qw422016 := qt422016.AcquireWriter(qq422016)
//line ../../web/auth.qtpl:19
p.StreamLang(qw422016)
//line ../../web/auth.qtpl:19
qt422016.ReleaseWriter(qw422016)
//line ../../web/auth.qtpl:19
}
//line ../../web/auth.qtpl:19
func (p *AuthPage) Lang() string {
//line ../../web/auth.qtpl:19
qb422016 := qt422016.AcquireByteBuffer()
//line ../../web/auth.qtpl:19
p.WriteLang(qb422016)
//line ../../web/auth.qtpl:19
qs422016 := string(qb422016.B)
//line ../../web/auth.qtpl:19
qt422016.ReleaseByteBuffer(qb422016)
//line ../../web/auth.qtpl:19
return qs422016
//line ../../web/auth.qtpl:19
}
//line ../../web/auth.qtpl:21
func (p *AuthPage) StreamTitle(qw422016 *qt422016.Writer) {
//line ../../web/auth.qtpl:21
qw422016.N().S(`
Authorize `)
//line ../../web/auth.qtpl:22
qw422016.E().S(p.Client.Name)
//line ../../web/auth.qtpl:22
qw422016.N().S(`
`)
//line ../../web/auth.qtpl:23
}
//line ../../web/auth.qtpl:23
func (p *AuthPage) WriteTitle(qq422016 qtio422016.Writer) {
//line ../../web/auth.qtpl:23
qw422016 := qt422016.AcquireWriter(qq422016)
//line ../../web/auth.qtpl:23
p.StreamTitle(qw422016)
//line ../../web/auth.qtpl:23
qt422016.ReleaseWriter(qw422016)
//line ../../web/auth.qtpl:23
}
//line ../../web/auth.qtpl:23
func (p *AuthPage) Title() string {
//line ../../web/auth.qtpl:23
qb422016 := qt422016.AcquireByteBuffer()
//line ../../web/auth.qtpl:23
p.WriteTitle(qb422016)
//line ../../web/auth.qtpl:23
qs422016 := string(qb422016.B)
//line ../../web/auth.qtpl:23
qt422016.ReleaseByteBuffer(qb422016)
//line ../../web/auth.qtpl:23
return qs422016
//line ../../web/auth.qtpl:23
}
//line ../../web/auth.qtpl:25
func (p *AuthPage) StreamHead(qw422016 *qt422016.Writer) {
//line ../../web/auth.qtpl:25
qw422016.N().S(`
`)
//line ../../web/auth.qtpl:26
}
//line ../../web/auth.qtpl:26
func (p *AuthPage) WriteHead(qq422016 qtio422016.Writer) {
//line ../../web/auth.qtpl:26
qw422016 := qt422016.AcquireWriter(qq422016)
//line ../../web/auth.qtpl:26
p.StreamHead(qw422016)
//line ../../web/auth.qtpl:26
qt422016.ReleaseWriter(qw422016)
//line ../../web/auth.qtpl:26
}
//line ../../web/auth.qtpl:26
func (p *AuthPage) Head() string {
//line ../../web/auth.qtpl:26
qb422016 := qt422016.AcquireByteBuffer()
//line ../../web/auth.qtpl:26
p.WriteHead(qb422016)
//line ../../web/auth.qtpl:26
qs422016 := string(qb422016.B)
//line ../../web/auth.qtpl:26
qt422016.ReleaseByteBuffer(qb422016)
//line ../../web/auth.qtpl:26
return qs422016
//line ../../web/auth.qtpl:26
}
//line ../../web/auth.qtpl:28
func (p *AuthPage) StreamBody(qw422016 *qt422016.Writer) {
//line ../../web/auth.qtpl:28
qw422016.N().S(`
`)
//line ../../web/auth.qtpl:29
if p.Client.Logo != "" {
//line ../../web/auth.qtpl:29
qw422016.N().S(`
<img
alt="`)
//line ../../web/auth.qtpl:31
qw422016.E().S(p.Client.Name)
//line ../../web/auth.qtpl:31
qw422016.N().S(`"
crossorigin="anonymous"
decoding="async"
height="140"
importance="high"
loading="lazy"
referrerpolicy="no-referrer-when-downgrade"
src="`)
//line ../../web/auth.qtpl:38
qw422016.E().S(p.Client.Logo)
//line ../../web/auth.qtpl:38
qw422016.N().S(`"
width="140">
`)
//line ../../web/auth.qtpl:40
}
//line ../../web/auth.qtpl:40
qw422016.N().S(`
<h2>`)
//line ../../web/auth.qtpl:42
qw422016.E().S(p.Client.Name)
//line ../../web/auth.qtpl:42
qw422016.N().S(`</h2>
<form
accept-charset="utf-8"
action="/authorize"
autocomplete="off"
enctype="application/x-www-form-urlencoded"
method="post"
novalidate="true"
target="_self">
`)
//line ../../web/auth.qtpl:53
if p.CSRF != nil {
//line ../../web/auth.qtpl:53
qw422016.N().S(`
<input
name="_csrf"
type="hidden"
value="`)
//line ../../web/auth.qtpl:57
qw422016.E().Z(p.CSRF)
//line ../../web/auth.qtpl:57
qw422016.N().S(`">
`)
//line ../../web/auth.qtpl:58
}
//line ../../web/auth.qtpl:58
qw422016.N().S(`
<input
name="response_type"
type="hidden"
value="code">
<input
name="client_id"
type="hidden"
value="`)
//line ../../web/auth.qtpl:68
qw422016.E().S(p.Client.URL)
//line ../../web/auth.qtpl:68
qw422016.N().S(`">
<input
name="redirect_uri"
type="hidden"
value="`)
//line ../../web/auth.qtpl:73
qw422016.E().S(p.RedirectURI)
//line ../../web/auth.qtpl:73
qw422016.N().S(`">
<input
name="state"
type="hidden"
value="`)
//line ../../web/auth.qtpl:78
qw422016.E().Z(p.State)
//line ../../web/auth.qtpl:78
qw422016.N().S(`">
`)
//line ../../web/auth.qtpl:80
if p.CodeChallenge != "" {
//line ../../web/auth.qtpl:80
qw422016.N().S(`
<input
name="code_challenge"
type="hidden"
value="`)
//line ../../web/auth.qtpl:84
qw422016.E().S(p.CodeChallenge)
//line ../../web/auth.qtpl:84
qw422016.N().S(`">
<input
name="code_challenge_method"
type="hidden"
value="`)
//line ../../web/auth.qtpl:89
qw422016.E().S(p.CodeChallengeMethod)
//line ../../web/auth.qtpl:89
qw422016.N().S(`">
`)
//line ../../web/auth.qtpl:90
}
//line ../../web/auth.qtpl:90
qw422016.N().S(`
`)
//line ../../web/auth.qtpl:92
if p.Scope != "" {
//line ../../web/auth.qtpl:92
qw422016.N().S(`
<input
name="scope"
type="hidden"
value="`)
//line ../../web/auth.qtpl:96
qw422016.E().S(p.Scope)
//line ../../web/auth.qtpl:96
qw422016.N().S(`">
`)
//line ../../web/auth.qtpl:97
}
//line ../../web/auth.qtpl:97
qw422016.N().S(`
`)
//line ../../web/auth.qtpl:99
if p.Me != "" {
//line ../../web/auth.qtpl:99
qw422016.N().S(`
<input
name="me"
type="hidden"
value="`)
//line ../../web/auth.qtpl:103
qw422016.E().S(p.Me)
//line ../../web/auth.qtpl:103
qw422016.N().S(`">
`)
//line ../../web/auth.qtpl:104
}
//line ../../web/auth.qtpl:104
qw422016.N().S(`
<button
name="authorize"
type="submit"
value="deny">
Deny
</button>
<button
name="authorize"
type="submit"
value="allow">
Allow
</button>
</form>
`)
//line ../../web/auth.qtpl:120
}
//line ../../web/auth.qtpl:120
func (p *AuthPage) WriteBody(qq422016 qtio422016.Writer) {
//line ../../web/auth.qtpl:120
qw422016 := qt422016.AcquireWriter(qq422016)
//line ../../web/auth.qtpl:120
p.StreamBody(qw422016)
//line ../../web/auth.qtpl:120
qt422016.ReleaseWriter(qw422016)
//line ../../web/auth.qtpl:120
}
//line ../../web/auth.qtpl:120
func (p *AuthPage) Body() string {
//line ../../web/auth.qtpl:120
qb422016 := qt422016.AcquireByteBuffer()
//line ../../web/auth.qtpl:120
p.WriteBody(qb422016)
//line ../../web/auth.qtpl:120
qs422016 := string(qb422016.B)
//line ../../web/auth.qtpl:120
qt422016.ReleaseByteBuffer(qb422016)
//line ../../web/auth.qtpl:120
return qs422016
//line ../../web/auth.qtpl:120
}