Browse Source

Use `ImagedProvider` for gplus oauth2 provider (#18504) (#18505)

- Bacport of #18504

Co-authored-by: 6543 <6543@obermui.de>
tags/v1.16.1
Gusted 3 years ago committed by GitHub
parent
commit
483bda4b2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      services/auth/source/oauth2/providers_simple.go

5
services/auth/source/oauth2/providers_simple.go

@ -70,13 +70,13 @@ func init() {
})) }))
// named gplus due to legacy gplus -> google migration (Google killed Google+). This ensures old connections still work // named gplus due to legacy gplus -> google migration (Google killed Google+). This ensures old connections still work
RegisterGothProvider(NewSimpleProvider("gplus", "Google", []string{"email"}, RegisterGothProvider(NewImagedProvider("/assets/img/auth/google.png", NewSimpleProvider("gplus", "Google", []string{"email"},
func(clientKey, secret, callbackURL string, scopes ...string) goth.Provider { func(clientKey, secret, callbackURL string, scopes ...string) goth.Provider {
if setting.OAuth2Client.UpdateAvatar || setting.OAuth2Client.EnableAutoRegistration { if setting.OAuth2Client.UpdateAvatar || setting.OAuth2Client.EnableAutoRegistration {
scopes = append(scopes, "profile") scopes = append(scopes, "profile")
} }
return google.New(clientKey, secret, callbackURL, scopes...) return google.New(clientKey, secret, callbackURL, scopes...)
})) })))
RegisterGothProvider(NewSimpleProvider("twitter", "Twitter", nil, RegisterGothProvider(NewSimpleProvider("twitter", "Twitter", nil,
func(clientKey, secret, callbackURL string, scopes ...string) goth.Provider { func(clientKey, secret, callbackURL string, scopes ...string) goth.Provider {
@ -107,5 +107,4 @@ func init() {
return microsoftonline.New(clientID, secret, callbackURL, scopes...) return microsoftonline.New(clientID, secret, callbackURL, scopes...)
}, },
)) ))
} }

Loading…
Cancel
Save