Custom icons for OAuth sources (#14161)

* Add Icon URL to Backend

* Template for Icon URL

* Localization & Edit Icon URL

* Improve Custom Icon URL

* Removed not working else

Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
Timo Ley 2020-12-28 03:35:55 +01:00 committed by GitHub
parent f6ca44c706
commit 2b2a4a53bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 17 additions and 1 deletions

View file

@ -131,6 +131,7 @@ type OAuth2Config struct {
ClientSecret string
OpenIDConnectAutoDiscoveryURL string
CustomURLMapping *oauth2.CustomURLMapping
IconURL string
}
// FromDB fills up an OAuth2Config from serialized format.

View file

@ -111,7 +111,11 @@ func GetActiveOAuth2Providers() ([]string, map[string]OAuth2Provider, error) {
var orderedKeys []string
providers := make(map[string]OAuth2Provider)
for _, source := range loginSources {
providers[source.Name] = OAuth2Providers[source.OAuth2().Provider]
prov := OAuth2Providers[source.OAuth2().Provider]
if source.OAuth2().IconURL != "" {
prov.Image = source.OAuth2().IconURL
}
providers[source.Name] = prov
orderedKeys = append(orderedKeys, source.Name)
}