From 4073e1e0d7d2f66b646cb4949bec53c199f87db7 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 19 Feb 2024 10:52:45 +0100 Subject: [PATCH] Show client ID on authorize page --- oauth2.go | 7 ++++++- template/authorize.html | 2 +- diff --git a/oauth2.go b/oauth2.go index c684bd4e4299f0a33d6210eab447b9aa8a3745c3..1ffc95a445cd6ae6dce954b405f24de3fa5cc948 100644 --- a/oauth2.go +++ b/oauth2.go @@ -108,7 +108,12 @@ } _ = req.ParseForm() if _, ok := req.PostForm["authorize"]; !ok { - if err := tpl.ExecuteTemplate(w, "authorize.html", nil); err != nil { + data := struct { + Client *Client + }{ + Client: client, + } + if err := tpl.ExecuteTemplate(w, "authorize.html", data); err != nil { panic(err) } return diff --git a/template/authorize.html b/template/authorize.html index 48d9f282b17696adbb311d1f730a036d2e9065a9..485230e11f9525d5b7a5975bbe3881dc9c1873b6 100644 --- a/template/authorize.html +++ b/template/authorize.html @@ -4,7 +4,7 @@

sinwon

-

Authorize client?

+

Authorize client {{ .Client.ClientID }}?

-- 2.48.1