show requested scope

This commit is contained in:
Niko Abeler 2022-11-07 20:24:21 +01:00
parent 3495822ec3
commit 0dc200e0b0
2 changed files with 10 additions and 0 deletions

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),