Ejemplo n.º 1
0
        public async Task <ApplicationUser> VerifyUserAsync(RegistrationLoginModel model)
        {
            var user = new ApplicationUser {
                Email = model.Email
            };

            var userInfo = await _repo.GetUserInfoAsync(u => u.Email == model.Email);

            var salt         = Convert.FromBase64String(userInfo.Salt);
            var hashPassword = Convert.FromBase64String(userInfo.Password);

            var isVerified = PasswordHashHelper.VerifyPassword(model.Password, salt, hashPassword);

            return(isVerified ? userInfo : null);
        }