Exemplo n.º 1
0
        private bool RightEmailPass(string email, string password)
        {
            passwordKey = _configuration.GetSection("Keys:PasswordDecrypter").Value.ToString();
            User   user = _context.Users.FirstOrDefault(x => x.Email.ToLower().Trim().Equals(email.ToLower().Trim()));
            string decryptedUserPass = SecurePasswordHasher.Decrypt(user.Password, passwordKey);

            if (decryptedUserPass.Equals(password))
            {
                return(true);
            }
            return(false);
        }