示例#1
0
        private void CreateUser(RegisterUserTestData.RegisterUser user)
        {
            new SaltedHash().GetHashAndSaltString(user.Password, out var hash, out var salt);

            var authRepo = AppHost.Container.Resolve <IAuthRepository>();

            authRepo.CreateUserAuth(new AppUser
            {
                Id           = user.Id,
                DisplayName  = "DisplayName",
                Email        = user.Email,
                UserName     = user.Username,
                PasswordHash = hash,
                Salt         = salt,
                Roles        = user.Roles,
                Permissions  = user.Permissions
            }, user.Password);
        }
示例#2
0
 protected virtual void RegisterAdminUser(RegisterUserTestData.RegisterUser user)
 {
     CreateUser(user);
 }