Example #1
0
        private bool IsValid(ref UserModel userModel)
        {
            var crypto = new SimpleCrypto.PBKDF2();

            var isValid = false;

            var user = UserDbUtilities.GetUser(userModel.Email);

            if (user != null)
            {
                if (user.Parola == crypto.Compute(userModel.Parola, user.CheieParola))
                {
                    isValid      = true;
                    userModel.id = user.Id;
                }
            }

            return(isValid);
        }