IndieAuth #25

Merged
h4kor merged 19 commits from auth into master 2022-11-07 19:38:21 +00:00
2 changed files with 10 additions and 0 deletions
Showing only changes of commit 0dc200e0b0 - Show all commits

View File

@ -1,5 +1,12 @@
<h2>Authorization for {{.ClientId}}</h2>
Requesting scope:
<ul>
{{range .Scopes}}
<li>{{.}}</li>
{{end}}
</ul>
<form action="verify/" method="post">
<label for="password">Password</label>
<input type="password" name="password" placeholder="Password">

View File

@ -4,6 +4,7 @@ import (
"bytes"
_ "embed"
"html/template"
"strings"
)
type PageContent struct {
@ -26,6 +27,7 @@ type AuthRequestData struct {
RedirectUri string
State string
Scope string
Scopes []string // Split version of scope. filled by rendering function.
ResponseType string
CodeChallenge string
CodeChallengeMethod string
@ -128,6 +130,7 @@ func RenderUserAuthPage(reqData AuthRequestData) (string, error) {
return "", err
}
reqData.Scopes = strings.Split(reqData.Scope, " ")
return renderIntoBaseTemplate(reqData.User, PageContent{
Title: "Auth",
Content: template.HTML(authHtml),