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

- Bacport of #18504

Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
Gusted 2022-02-01 03:45:58 +01:00 committed by GitHub
parent edd57028a1
commit 483bda4b2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -70,13 +70,13 @@ func init() {
}))
// 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 {
if setting.OAuth2Client.UpdateAvatar || setting.OAuth2Client.EnableAutoRegistration {
scopes = append(scopes, "profile")
}
return google.New(clientKey, secret, callbackURL, scopes...)
}))
})))
RegisterGothProvider(NewSimpleProvider("twitter", "Twitter", nil,
func(clientKey, secret, callbackURL string, scopes ...string) goth.Provider {
@ -107,5 +107,4 @@ func init() {
return microsoftonline.New(clientID, secret, callbackURL, scopes...)
},
))
}