public User AddUser(string login, string pass, string publicMessage, string privateNotes) { var user = new User { Id = Guid.NewGuid(), Login = login, PublicMessage = publicMessage, PrivateNotes = privateNotes, PasswordHash = CryptUtils.CalcHash(pass) }; statePersister.SaveUser(user); return(AddUser(user)); }
public User FindUser(string login, string pass) { User user; return(users.TryGetValue(login, out user) && user.PasswordHash == CryptUtils.CalcHash(pass) ? user : null); }