private void Submit() { if (Password != null) { MasterPasswordHasher hasher = new MasterPasswordHasher(); hasher.HashedPassword = userInfo.MasterPassword; hasher.SaltValue = userInfo.PasswordHash; if (hasher.VerifyPassword(Core.SecureStringToString(Password)) && (TwoFactorCode == this.TfaCode)) { this.CloseAction(); } else { ErrorsVisibility = Visibility.Visible; } } }
private void Submit() { //this.SubmitCommand.RaiseCanExecuteChanged(); if (!IsInputValid()) { return; } Database db = new Database(); UserInfo userInfo = new UserInfo(false); userInfo.Forename = this.Forename; userInfo.Surname = this.Surname; userInfo.EmailAddress = this.EmailAddress; MasterPasswordHasher hasher = new MasterPasswordHasher(); hasher.HashPassword(Core.SecureStringToString(this.Password)); userInfo.MasterPassword = hasher.HashedPassword; userInfo.PasswordHash = hasher.SaltValue; if (db.CreateNewUser(userInfo)) { Core.PrintDebug("Success!"); this.CloseAction(); } }