Remove email comparison after profile match check

This commit is contained in:
Denis Arh
2019-04-15 09:38:26 +02:00
parent f3d53ecd5b
commit f44648a3ea
+1 -7
View File
@@ -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