2022-01-04 17:31:33 +00:00
|
|
|
// 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
|
2022-07-28 18:13:24 +00:00
|
|
|
import (
|
|
|
|
"source.toby3d.me/toby3d/auth/internal/domain"
|
|
|
|
)
|
2022-01-04 17:31:33 +00:00
|
|
|
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:5
|
2022-01-04 17:31:33 +00:00
|
|
|
import (
|
|
|
|
qtio422016 "io"
|
|
|
|
|
|
|
|
qt422016 "github.com/valyala/quicktemplate"
|
|
|
|
)
|
|
|
|
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:5
|
2022-01-04 17:31:33 +00:00
|
|
|
var (
|
|
|
|
_ = qtio422016.Copy
|
|
|
|
_ = qt422016.AcquireByteBuffer
|
|
|
|
)
|
|
|
|
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:5
|
2022-01-20 19:50:15 +00:00
|
|
|
type AuthorizePage struct {
|
2022-01-04 17:31:33 +00:00
|
|
|
BaseOf
|
2022-01-31 16:15:38 +00:00
|
|
|
Scope domain.Scopes
|
2022-07-28 18:13:24 +00:00
|
|
|
CodeChallengeMethod domain.CodeChallengeMethod
|
|
|
|
ResponseType domain.ResponseType
|
2022-01-04 17:31:33 +00:00
|
|
|
Client *domain.Client
|
2022-01-20 19:50:15 +00:00
|
|
|
Me *domain.Me
|
2022-01-31 16:15:38 +00:00
|
|
|
RedirectURI *domain.URL
|
2022-07-28 18:13:24 +00:00
|
|
|
Providers []*domain.Provider
|
|
|
|
CSRF []byte
|
2022-01-04 17:31:33 +00:00
|
|
|
CodeChallenge string
|
|
|
|
State string
|
|
|
|
}
|
|
|
|
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:19
|
2023-08-06 00:42:38 +00:00
|
|
|
func (p *AuthorizePage) streamtitle(qw422016 *qt422016.Writer) {
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:19
|
2022-01-04 17:31:33 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
`)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:20
|
2023-08-07 03:10:00 +00:00
|
|
|
if p.Client.Name != "" {
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:20
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
`)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:21
|
2023-08-07 03:10:00 +00:00
|
|
|
p.streamt(qw422016, "Authorize %s", p.Client.Name)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:21
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
`)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:22
|
2022-01-20 19:50:15 +00:00
|
|
|
} else {
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:22
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
`)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:23
|
2023-08-06 00:42:38 +00:00
|
|
|
p.streamt(qw422016, "Authorize application")
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:23
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
`)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:24
|
2022-01-20 19:50:15 +00:00
|
|
|
}
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:24
|
2022-01-04 17:31:33 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:25
|
2022-01-04 17:31:33 +00:00
|
|
|
}
|
|
|
|
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:25
|
2023-08-06 00:42:38 +00:00
|
|
|
func (p *AuthorizePage) writetitle(qq422016 qtio422016.Writer) {
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:25
|
2022-01-04 17:31:33 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:25
|
2023-08-06 00:42:38 +00:00
|
|
|
p.streamtitle(qw422016)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:25
|
2022-01-04 17:31:33 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:25
|
2022-01-04 17:31:33 +00:00
|
|
|
}
|
|
|
|
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:25
|
2023-08-06 00:42:38 +00:00
|
|
|
func (p *AuthorizePage) title() string {
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:25
|
2022-01-04 17:31:33 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:25
|
2023-08-06 00:42:38 +00:00
|
|
|
p.writetitle(qb422016)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:25
|
2022-01-04 17:31:33 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:25
|
2022-01-04 17:31:33 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:25
|
2022-01-04 17:31:33 +00:00
|
|
|
return qs422016
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:25
|
2022-01-04 17:31:33 +00:00
|
|
|
}
|
|
|
|
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:27
|
2023-08-06 00:42:38 +00:00
|
|
|
func (p *AuthorizePage) streambody(qw422016 *qt422016.Writer) {
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:27
|
2022-01-04 17:31:33 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
<header>
|
|
|
|
`)
|
2022-01-31 16:15:38 +00:00
|
|
|
//line web/authorize.qtpl:29
|
2023-08-07 03:10:00 +00:00
|
|
|
if p.Client.Logo != nil {
|
2022-01-31 16:15:38 +00:00
|
|
|
//line web/authorize.qtpl:29
|
2022-07-28 18:13:24 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
<img class=""
|
|
|
|
crossorigin="anonymous"
|
|
|
|
decoding="async"
|
|
|
|
height="140"
|
|
|
|
importance="high"
|
|
|
|
loading="lazy"
|
|
|
|
referrerpolicy="no-referrer-when-downgrade"
|
|
|
|
src="`)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:37
|
2023-08-07 03:10:00 +00:00
|
|
|
qw422016.E().S(p.Client.Logo.String())
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:37
|
|
|
|
qw422016.N().S(`"
|
2023-01-14 21:27:37 +00:00
|
|
|
alt="`)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:38
|
2023-08-07 03:10:00 +00:00
|
|
|
qw422016.E().S(p.Client.Name)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:38
|
2022-01-04 17:31:33 +00:00
|
|
|
qw422016.N().S(`"
|
2023-01-14 21:27:37 +00:00
|
|
|
width="140">
|
|
|
|
`)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:40
|
2022-01-04 17:31:33 +00:00
|
|
|
}
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:40
|
2022-01-04 17:31:33 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
|
2023-01-14 21:27:37 +00:00
|
|
|
<h2>
|
|
|
|
`)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:43
|
2023-08-07 03:10:00 +00:00
|
|
|
if p.Client.URL != nil {
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:43
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
<a href="`)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:44
|
2023-08-07 03:10:00 +00:00
|
|
|
qw422016.E().S(p.Client.URL.String())
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:44
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.N().S(`">
|
|
|
|
`)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:45
|
2022-01-20 19:50:15 +00:00
|
|
|
}
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:45
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:46
|
2023-08-07 03:10:00 +00:00
|
|
|
if p.Client.Name != "" {
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:46
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
`)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:47
|
2023-08-07 03:10:00 +00:00
|
|
|
qw422016.E().S(p.Client.Name)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:47
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:48
|
2022-01-20 19:50:15 +00:00
|
|
|
} else {
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:48
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
`)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:49
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.E().S(p.Client.ID.String())
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:49
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:50
|
2022-01-20 19:50:15 +00:00
|
|
|
}
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:50
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:51
|
2023-08-07 03:10:00 +00:00
|
|
|
if p.Client.URL != nil {
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:51
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
</a>
|
|
|
|
`)
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:53
|
2022-01-20 19:50:15 +00:00
|
|
|
}
|
2022-07-28 18:13:24 +00:00
|
|
|
//line web/authorize.qtpl:53
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
</h2>
|
|
|
|
</header>
|
2022-01-20 19:50:15 +00:00
|
|
|
|
2023-01-14 21:27:37 +00:00
|
|
|
<main>
|
2023-08-05 19:10:24 +00:00
|
|
|
<aside>
|
|
|
|
`)
|
|
|
|
//line web/authorize.qtpl:59
|
|
|
|
if p.CodeChallengeMethod != domain.CodeChallengeMethodUnd && p.CodeChallenge != "" {
|
|
|
|
//line web/authorize.qtpl:59
|
|
|
|
qw422016.N().S(`
|
|
|
|
<p class="with-icon">
|
|
|
|
<span class="icon"
|
|
|
|
role="img"
|
|
|
|
aria-label="closed lock with key">🔐</span>
|
|
|
|
|
|
|
|
`)
|
|
|
|
//line web/authorize.qtpl:65
|
2023-08-06 00:42:38 +00:00
|
|
|
p.streamt(qw422016, `This client uses %sPKCE%s with the %s%s%s method.`, `<abbr title="Proof of Key Code Exchange">`,
|
2023-08-05 19:10:24 +00:00
|
|
|
`</abbr>`, `<code>`, p.CodeChallengeMethod, `</code>`)
|
|
|
|
//line web/authorize.qtpl:66
|
|
|
|
qw422016.N().S(`
|
|
|
|
</p>
|
|
|
|
`)
|
|
|
|
//line web/authorize.qtpl:68
|
|
|
|
} else {
|
|
|
|
//line web/authorize.qtpl:68
|
|
|
|
qw422016.N().S(`
|
|
|
|
<details>
|
|
|
|
<summary class="with-icon">
|
|
|
|
<span class="icon"
|
|
|
|
role="img"
|
|
|
|
aria-label="unlock">🔓</span>
|
|
|
|
|
|
|
|
`)
|
|
|
|
//line web/authorize.qtpl:75
|
2023-08-06 00:42:38 +00:00
|
|
|
p.streamt(qw422016, `This client does not use %sPKCE%s!`, `<abbr title="Proof of Key Code Exchange">`, `</abbr>`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:75
|
|
|
|
qw422016.N().S(`
|
|
|
|
</summary>
|
|
|
|
<p>
|
|
|
|
`)
|
|
|
|
//line web/authorize.qtpl:78
|
2023-08-06 00:42:38 +00:00
|
|
|
p.streamt(qw422016, `%sProof of Key Code Exchange%s is a mechanism that protects against attackers in the middle hijacking `+
|
2023-08-05 19:10:24 +00:00
|
|
|
`your application's authentication process. You can still authorize this application without this protection, `+
|
|
|
|
`but you must independently verify the security of this connection. If you have any doubts - stop the process `+
|
|
|
|
` and contact the developers.`, `<dfn id="PKCE">`, `</dfn>`)
|
|
|
|
//line web/authorize.qtpl:81
|
|
|
|
qw422016.N().S(`
|
|
|
|
</p>
|
|
|
|
</details>
|
|
|
|
`)
|
|
|
|
//line web/authorize.qtpl:84
|
|
|
|
}
|
|
|
|
//line web/authorize.qtpl:84
|
|
|
|
qw422016.N().S(`
|
|
|
|
</aside>
|
|
|
|
|
2023-01-14 21:27:37 +00:00
|
|
|
<form class=""
|
|
|
|
accept-charset="utf-8"
|
|
|
|
action="/authorize/verify"
|
|
|
|
autocomplete="off"
|
|
|
|
enctype="application/x-www-form-urlencoded"
|
|
|
|
method="post"
|
|
|
|
novalidate="true"
|
|
|
|
target="_self">
|
2022-01-04 17:31:33 +00:00
|
|
|
|
2023-01-14 21:27:37 +00:00
|
|
|
`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:96
|
2022-01-20 19:50:15 +00:00
|
|
|
if p.CSRF != nil {
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:96
|
2022-01-04 17:31:33 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
<input type="hidden"
|
|
|
|
name="_csrf"
|
|
|
|
value="`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:99
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.E().Z(p.CSRF)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:99
|
2022-01-04 17:31:33 +00:00
|
|
|
qw422016.N().S(`">
|
2023-01-14 21:27:37 +00:00
|
|
|
`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:100
|
2022-01-04 17:31:33 +00:00
|
|
|
}
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:100
|
2022-01-04 17:31:33 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
|
2023-01-14 21:27:37 +00:00
|
|
|
`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:102
|
2022-01-20 19:50:15 +00:00
|
|
|
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,
|
|
|
|
} {
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:107
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
<input type="hidden"
|
|
|
|
name="`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:109
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.E().S(key)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:109
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.N().S(`"
|
2023-01-14 21:27:37 +00:00
|
|
|
value="`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:110
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.E().S(val)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:110
|
2022-01-04 17:31:33 +00:00
|
|
|
qw422016.N().S(`">
|
2023-01-14 21:27:37 +00:00
|
|
|
`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:111
|
2022-01-20 19:50:15 +00:00
|
|
|
}
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:111
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.N().S(`
|
2022-01-04 17:31:33 +00:00
|
|
|
|
2023-01-14 21:27:37 +00:00
|
|
|
`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:113
|
2022-01-20 19:50:15 +00:00
|
|
|
if len(p.Scope) > 0 {
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:113
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
<fieldset>
|
|
|
|
<legend>`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:115
|
2023-08-06 00:42:38 +00:00
|
|
|
p.streamt(qw422016, "Scopes")
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:115
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.N().S(`</legend>
|
|
|
|
|
2023-01-14 21:27:37 +00:00
|
|
|
`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:117
|
2022-01-20 19:50:15 +00:00
|
|
|
for _, scope := range p.Scope {
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:117
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
<div>
|
|
|
|
<label>
|
|
|
|
<input type="checkbox"
|
|
|
|
name="scope[]"
|
|
|
|
value="`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:122
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.E().S(scope.String())
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:122
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.N().S(`"
|
2023-01-14 21:27:37 +00:00
|
|
|
checked>
|
2022-01-20 19:50:15 +00:00
|
|
|
|
2023-01-14 21:27:37 +00:00
|
|
|
`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:125
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.E().S(scope.String())
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:125
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:128
|
2022-01-20 19:50:15 +00:00
|
|
|
}
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:128
|
2022-01-20 19:50:15 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
</fieldset>
|
|
|
|
`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:130
|
|
|
|
} else {
|
|
|
|
//line web/authorize.qtpl:130
|
|
|
|
qw422016.N().S(`
|
|
|
|
<aside>
|
|
|
|
<p>`)
|
|
|
|
//line web/authorize.qtpl:132
|
2023-08-06 00:42:38 +00:00
|
|
|
p.streamt(qw422016, `No scopes is requested: the application will only get your profile URL.`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:132
|
|
|
|
qw422016.N().S(`</p>
|
|
|
|
</aside>
|
|
|
|
`)
|
|
|
|
//line web/authorize.qtpl:134
|
2022-01-04 17:31:33 +00:00
|
|
|
}
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:134
|
2022-01-04 17:31:33 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
|
2023-01-14 21:27:37 +00:00
|
|
|
`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:136
|
2022-01-20 19:50:15 +00:00
|
|
|
if p.CodeChallenge != "" {
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:136
|
2022-01-04 17:31:33 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-16 10:19:22 +00:00
|
|
|
`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:137
|
2023-01-16 10:19:22 +00:00
|
|
|
for key, val := range map[string]string{
|
|
|
|
"code_challenge": p.CodeChallenge,
|
|
|
|
"code_challenge_method": p.CodeChallengeMethod.String(),
|
|
|
|
} {
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:140
|
2023-01-16 10:19:22 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
<input type="hidden"
|
2023-01-16 10:19:22 +00:00
|
|
|
name="`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:142
|
2023-01-16 10:19:22 +00:00
|
|
|
qw422016.E().S(key)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:142
|
2023-01-16 10:19:22 +00:00
|
|
|
qw422016.N().S(`"
|
2023-01-14 21:27:37 +00:00
|
|
|
value="`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:143
|
2023-01-16 10:19:22 +00:00
|
|
|
qw422016.E().S(val)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:143
|
2023-01-16 10:19:22 +00:00
|
|
|
qw422016.N().S(`">
|
2023-01-14 21:27:37 +00:00
|
|
|
`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:144
|
2023-01-16 10:19:22 +00:00
|
|
|
}
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:144
|
2023-01-16 10:19:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:145
|
2023-01-16 10:19:22 +00:00
|
|
|
}
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:145
|
2022-01-04 17:31:33 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
|
2023-01-14 21:27:37 +00:00
|
|
|
`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:147
|
2022-01-04 17:31:33 +00:00
|
|
|
if p.Me != nil {
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:147
|
2022-01-04 17:31:33 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
<input type="hidden"
|
|
|
|
name="me"
|
|
|
|
value="`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:150
|
2022-01-04 17:31:33 +00:00
|
|
|
qw422016.E().S(p.Me.String())
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:150
|
2022-01-04 17:31:33 +00:00
|
|
|
qw422016.N().S(`">
|
2023-01-14 21:27:37 +00:00
|
|
|
`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:151
|
2022-01-04 17:31:33 +00:00
|
|
|
}
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:151
|
2022-01-31 16:15:38 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
|
2023-01-14 21:27:37 +00:00
|
|
|
`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:153
|
2022-01-31 16:15:38 +00:00
|
|
|
if len(p.Providers) > 0 {
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:153
|
2022-01-31 16:15:38 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
<select name="provider"
|
|
|
|
autocomplete
|
|
|
|
required>
|
2022-01-31 16:15:38 +00:00
|
|
|
|
2023-01-14 21:27:37 +00:00
|
|
|
`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:158
|
2022-01-31 16:15:38 +00:00
|
|
|
for _, provider := range p.Providers {
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:158
|
2022-01-31 16:15:38 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
<option value="`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:159
|
2022-01-31 16:15:38 +00:00
|
|
|
qw422016.E().S(provider.UID)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:159
|
2022-01-31 16:15:38 +00:00
|
|
|
qw422016.N().S(`"
|
|
|
|
`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:160
|
2022-01-31 16:15:38 +00:00
|
|
|
if provider.UID == "mastodon" {
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:160
|
2022-01-31 16:15:38 +00:00
|
|
|
qw422016.N().S(`selected`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:160
|
2022-01-31 16:15:38 +00:00
|
|
|
}
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:160
|
2022-01-31 16:15:38 +00:00
|
|
|
qw422016.N().S(`>
|
|
|
|
|
2023-01-14 21:27:37 +00:00
|
|
|
`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:162
|
2022-01-31 16:15:38 +00:00
|
|
|
qw422016.E().S(provider.Name)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:162
|
2022-01-31 16:15:38 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
</option>
|
|
|
|
`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:164
|
2022-01-31 16:15:38 +00:00
|
|
|
}
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:164
|
2022-01-31 16:15:38 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
</select>
|
|
|
|
`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:166
|
2022-01-31 16:15:38 +00:00
|
|
|
} else {
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:166
|
2022-01-31 16:15:38 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
<input type="hidden"
|
|
|
|
name="provider"
|
|
|
|
value="direct">
|
|
|
|
`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:170
|
2022-01-31 16:15:38 +00:00
|
|
|
}
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:170
|
2022-01-04 17:31:33 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
|
2023-01-14 21:27:37 +00:00
|
|
|
<button type="submit"
|
|
|
|
name="authorize"
|
|
|
|
value="deny">
|
2022-01-04 17:31:33 +00:00
|
|
|
|
2023-01-14 21:27:37 +00:00
|
|
|
`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:176
|
2023-08-06 00:42:38 +00:00
|
|
|
p.streamt(qw422016, "Deny")
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:176
|
2022-01-04 17:31:33 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
</button>
|
2022-01-04 17:31:33 +00:00
|
|
|
|
2023-01-14 21:27:37 +00:00
|
|
|
<button type="submit"
|
|
|
|
name="authorize"
|
|
|
|
value="allow">
|
2022-01-04 17:31:33 +00:00
|
|
|
|
2023-01-14 21:27:37 +00:00
|
|
|
`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:183
|
2023-08-06 00:42:38 +00:00
|
|
|
p.streamt(qw422016, "Allow")
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:183
|
2022-01-04 17:31:33 +00:00
|
|
|
qw422016.N().S(`
|
2023-01-14 21:27:37 +00:00
|
|
|
</button>
|
2023-08-05 19:10:24 +00:00
|
|
|
|
|
|
|
<aside>
|
|
|
|
<p>`)
|
|
|
|
//line web/authorize.qtpl:187
|
2023-08-06 00:42:38 +00:00
|
|
|
p.streamt(qw422016, `You will be redirected to %s%s%s`, `<code>`, p.RedirectURI, `</code>`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:187
|
|
|
|
qw422016.N().S(`</p>
|
|
|
|
</aside>
|
2023-01-14 21:27:37 +00:00
|
|
|
</form>
|
|
|
|
</main>
|
2022-01-04 17:31:33 +00:00
|
|
|
`)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:191
|
2022-01-04 17:31:33 +00:00
|
|
|
}
|
|
|
|
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:191
|
2023-08-06 00:42:38 +00:00
|
|
|
func (p *AuthorizePage) writebody(qq422016 qtio422016.Writer) {
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:191
|
2022-01-04 17:31:33 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:191
|
2023-08-06 00:42:38 +00:00
|
|
|
p.streambody(qw422016)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:191
|
2022-01-04 17:31:33 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:191
|
2022-01-04 17:31:33 +00:00
|
|
|
}
|
|
|
|
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:191
|
2023-08-06 00:42:38 +00:00
|
|
|
func (p *AuthorizePage) body() string {
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:191
|
2022-01-04 17:31:33 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:191
|
2023-08-06 00:42:38 +00:00
|
|
|
p.writebody(qb422016)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:191
|
2022-01-04 17:31:33 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:191
|
2022-01-04 17:31:33 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:191
|
2022-01-04 17:31:33 +00:00
|
|
|
return qs422016
|
2023-08-05 19:10:24 +00:00
|
|
|
//line web/authorize.qtpl:191
|
2022-01-04 17:31:33 +00:00
|
|
|
}
|