fix google

This commit is contained in:
Tao Chen
2024-11-03 18:04:28 +08:00
parent 18d59d7047
commit 9dfe745629
2 changed files with 24 additions and 27 deletions

View File

@@ -170,7 +170,7 @@ func (os *OauthService) GetOauthConfig(op string) (err error, oauthInfo *model.O
oauthConfig.Scopes = []string{"read:user", "user:email"}
case model.OauthTypeGoogle:
oauthConfig.Endpoint = google.Endpoint
oauthConfig.Scopes = []string{"https://www.googleapis.com/auth/userinfo.profile", "https://www.googleapis.com/auth/userinfo.email"}
oauthConfig.Scopes = os.constructScopes(model.OIDC_DEFAULT_SCOPES)
case model.OauthTypeOidc:
var endpoint OidcEndpoint
err, endpoint = os.FetchOidcEndpoint(oauthInfo.Issuer)
@@ -374,7 +374,7 @@ func (os *OauthService) getScopesByOp(op string) []string {
func (os *OauthService) constructScopes(scopes string) []string {
scopes = strings.TrimSpace(scopes)
if scopes == "" {
scopes = "openid,profile,email"
scopes = model.OIDC_DEFAULT_SCOPES
}
return strings.Split(scopes, ",")
}