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:
parent
f6ca44c706
commit
2b2a4a53bf
7 changed files with 17 additions and 1 deletions
|
@ -131,6 +131,7 @@ type OAuth2Config struct {
|
|||
ClientSecret string
|
||||
OpenIDConnectAutoDiscoveryURL string
|
||||
CustomURLMapping *oauth2.CustomURLMapping
|
||||
IconURL string
|
||||
}
|
||||
|
||||
// FromDB fills up an OAuth2Config from serialized format.
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue