Normalize username.

This commit is contained in:
Jared 2020-12-16 20:15:45 -08:00 committed by Jared Goodwin
parent f53b33fb50
commit 4ea68cf40d

View File

@ -465,6 +465,7 @@ namespace Remotely.Server.Services
var org = RemotelyContext.Organizations
.Include(x => x.RemotelyUsers)
.FirstOrDefault(x => x.ID == organizationID);
RemotelyContext.Users.Add(user);
org.RemotelyUsers.Add(user);
await RemotelyContext.SaveChangesAsync();
return true;
@ -872,7 +873,7 @@ namespace Remotely.Server.Services
}
return RemotelyContext.Users
.Include(x => x.Organization)
.FirstOrDefault(x => x.UserName == userName);
.FirstOrDefault(x => x.UserName.ToLower().Trim() == userName.ToLower().Trim());
}
public RemotelyUserOptions GetUserOptions(string userName)