diff --git a/handlers/consent/consent_check.go b/handlers/consent/consent_check.go index bb8d86c..8604419 100644 --- a/handlers/consent/consent_check.go +++ b/handlers/consent/consent_check.go @@ -93,12 +93,21 @@ func ConsentCheck(ctx *gin.Context) { // Show the consent UI global.Logger.Debugf("Rendering consent UI...") - ctx.HTML(http.StatusOK, "consent.tmpl", gin.H{ - "client": consentReq.Client, + templateFields := gin.H{ "user": acceptCtx.User, "challenge": oauth2challenge, "csrf": csrf, - }) + } + + if consentReq.Client.LogoUri != nil && *consentReq.Client.LogoUri != "" { + templateFields["logo"] = *consentReq.Client.LogoUri + } + if consentReq.Client.ClientName != nil && *consentReq.Client.ClientName != "" { + templateFields["clientName"] = *consentReq.Client.ClientName + } else { + templateFields["clientName"] = *consentReq.Client.ClientId + } + ctx.HTML(http.StatusOK, "consent.tmpl", templateFields) global.Logger.Debugf("User should now see Consent UI.") } diff --git a/templates/consent.tmpl b/templates/consent.tmpl index 5577c1c..6e6c878 100644 --- a/templates/consent.tmpl +++ b/templates/consent.tmpl @@ -4,6 +4,9 @@