Auth: Enable case insensitive logins/emails by default (#84840)
* wip * wip * wip * wip postgres tests
This commit is contained in:
@@ -50,12 +50,9 @@ func (ss *SQLStore) createUser(ctx context.Context, sess *DBSession, args user.C
|
||||
args.Email = args.Login
|
||||
}
|
||||
|
||||
where := "email=? OR login=?"
|
||||
if ss.Cfg.CaseInsensitiveLogin {
|
||||
where = "LOWER(email)=LOWER(?) OR LOWER(login)=LOWER(?)"
|
||||
args.Login = strings.ToLower(args.Login)
|
||||
args.Email = strings.ToLower(args.Email)
|
||||
}
|
||||
where := "LOWER(email)=LOWER(?) OR LOWER(login)=LOWER(?)"
|
||||
args.Login = strings.ToLower(args.Login)
|
||||
args.Email = strings.ToLower(args.Email)
|
||||
|
||||
exists, err := sess.Where(where, args.Email, args.Login).Get(&user.User{})
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user