From 0dc200e0b0fe7a951207bc21e7fc4a646870bf84 Mon Sep 17 00:00:00 2001 From: Niko Abeler Date: Mon, 7 Nov 2022 20:24:21 +0100 Subject: [PATCH] show requested scope --- embed/auth.html | 7 +++++++ renderer.go | 3 +++ 2 files changed, 10 insertions(+) diff --git a/embed/auth.html b/embed/auth.html index 0c3a4b4..61fe7ea 100644 --- a/embed/auth.html +++ b/embed/auth.html @@ -1,5 +1,12 @@

Authorization for {{.ClientId}}

+Requesting scope: + +
diff --git a/renderer.go b/renderer.go index 3bdfee3..ccfbdaf 100644 --- a/renderer.go +++ b/renderer.go @@ -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),