Beispiel #1
0
        public Task <User> Authenticate(string username, string password)
        {
            var user = _users.GetByPredicate(u => u.Username == username);

            if (user != null && PasswordStorage.VerifyPassword(password, user.Password))
            {
                user.Password = null;
                return(Task.FromResult(user));
            }

            return(null);
        }