From f44648a3ea8f0c0aaafad26cce9101248b6710bf Mon Sep 17 00:00:00 2001 From: Denis Arh Date: Mon, 15 Apr 2019 09:38:26 +0200 Subject: [PATCH] Remove email comparison after profile match check --- system/internal/service/auth.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/system/internal/service/auth.go b/system/internal/service/auth.go index cab736704..8e36be650 100644 --- a/system/internal/service/auth.go +++ b/system/internal/service/auth.go @@ -139,14 +139,8 @@ func (svc *auth) External(profile goth.User) (u *types.User, err error) { } } return nil - } else if u.Valid() && u.Email != profile.Email { - return errors.Errorf( - "refusing to authenticate with non matching emails (profile: %v, db: %v) on credentials (ID: %v)", - profile.Email, - u.Email, - c.ID) } else if u.Valid() { - // Valid user, matching emails. Bingo! + // Valid user, Bingo! c.LastUsedAt = svc.now() if c, err = svc.credentials.Update(c); err != nil { return err