forked from gitea/gitea
1
0
Fork 0

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

Use `ImagedProvider` for gplus' oauthv2 provider, as the image isn't "gplus.png" but "google.png".

Resolves #18494
This commit is contained in:
Gusted 2022-02-01 01:02:56 +01:00 committed by GitHub
parent 70e614b9da
commit 22d266350d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

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 // 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 {