Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        public User FindUser(string login, string pass)
        {
            User user;

            return(users.TryGetValue(login, out user) && user.PasswordHash == CryptUtils.CalcHash(pass) ? user : null);
        }