Skip to content

Commit 615abbf

Browse files
Fix provider crash when userinfo email is nil (#6839) (#13056)
Fixes #13051 Signed-off-by: Modular Magician <[email protected]> Signed-off-by: Modular Magician <[email protected]>
1 parent f43c146 commit 615abbf

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.changelog/6839.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
provider: fixed a crash during provider authentication for certain environments
3+
```

google/utils.go

+3
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,9 @@ func GetCurrentUserEmail(config *Config, userAgent string) (string, error) {
519519
if err != nil {
520520
return "", fmt.Errorf("error retrieving userinfo for your provider credentials. have you enabled the 'https://www.googleapis.com/auth/userinfo.email' scope? error: %s", err)
521521
}
522+
if res["email"] == nil {
523+
return "", fmt.Errorf("error retrieving email from userinfo. email was nil in the response.")
524+
}
522525
return res["email"].(string), nil
523526
}
524527

0 commit comments

Comments
 (0)