loginsrv

Unnamed repository; edit this file 'description' to name the repository.
git clone git@jamesshield.xyz:repos/loginsrv.git
Log | Files | Refs | README | LICENSE

commit 51f4e57d0150681e4ca4754e48a81f8023aa5b92
parent 4885ce53ef5385fdd39f695ddbbd18426e2e8752
Author: Sebastian Mancke <s.mancke@tarent.de>
Date:   Thu, 17 Aug 2017 10:09:18 +0200

avoid panic in case of invalid repons from google

Diffstat:
Moauth2/google.go | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/oauth2/google.go b/oauth2/google.go @@ -56,6 +56,10 @@ var providerGoogle = Provider{ return model.UserInfo{}, "", fmt.Errorf("error parsing google get user info: %v", err) } + if len(gu.Emails) == 0 { + return model.UserInfo{}, "", fmt.Errorf("invalid google response: no email address returned.", err) + } + return model.UserInfo{ Sub: gu.Emails[0].Value, Picture: gu.Image.Url,