config: add branding settings (#3558)

This commit is contained in:
Caleb Doxsey 2022-08-16 14:51:47 -06:00 committed by GitHub
parent c9421ec146
commit 46703b9419
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 156 additions and 13 deletions

View file

@ -26,11 +26,13 @@ type UserInfoData struct {
WebAuthnCreationOptions *webauthn.PublicKeyCredentialCreationOptions
WebAuthnRequestOptions *webauthn.PublicKeyCredentialRequestOptions
WebAuthnURL string
BrandingOptions httputil.BrandingOptions
}
// ToJSON converts the data into a JSON map.
func (data UserInfoData) ToJSON() map[string]interface{} {
m := map[string]interface{}{}
func (data UserInfoData) ToJSON() map[string]any {
m := map[string]any{}
m["csrfToken"] = data.CSRFToken
var directoryGroups []json.RawMessage
for _, directoryGroup := range data.DirectoryGroups {
@ -52,6 +54,7 @@ func (data UserInfoData) ToJSON() map[string]interface{} {
m["webAuthnCreationOptions"] = data.WebAuthnCreationOptions
m["webAuthnRequestOptions"] = data.WebAuthnRequestOptions
m["webAuthnUrl"] = data.WebAuthnURL
httputil.AddBrandingOptionsToMap(m, data.BrandingOptions)
return m
}