Пример #1
0
        public async Task <bool> RegisterUserAsync(ApplicationUser model)
        {
            var salt         = PasswordHashHelper.GenerateSalt();
            var passwordHash = PasswordHashHelper.ComputeHash(model.Password, salt);

            model.Salt     = Convert.ToBase64String(salt);
            model.Password = Convert.ToBase64String(passwordHash);

            var isRegistrationSuccessful = await _repo.AddAsync(model);

            return(isRegistrationSuccessful ? true : false);
        }