/// <summary> /// Add configuration of GoogleAuthenticator /// </summary> /// <param name="customerEmail">Customer email</param> /// <param name="key">Secret key</param> /// <returns>A task that represents the asynchronous operation</returns> public virtual async Task AddGoogleAuthenticatorAccountAsync(string customerEmail, string key) { var account = new GoogleAuthenticatorRecord { Customer = customerEmail, SecretKey = key, }; await InsertConfigurationAsync(account); }
/// <summary> /// Insert the configuration /// </summary> /// <param name="configuration">Configuration</param> protected void InsertConfiguration(GoogleAuthenticatorRecord configuration) { if (configuration == null) { throw new ArgumentNullException(nameof(configuration)); } _repository.Insert(configuration); _staticCacheManager.RemoveByPrefix(GoogleAuthenticatorDefaults.PrefixCacheKey); }
/// <summary> /// Delete the configuration /// </summary> /// <param name="configuration">Configuration</param> internal void DeleteConfiguration(GoogleAuthenticatorRecord configuration) { if (configuration == null) { throw new ArgumentNullException(nameof(configuration)); } _repository.Delete(configuration); _staticCacheManager.RemoveByPrefix(GoogleAuthenticatorDefaults.PrefixCacheKey); }
/// <summary> /// Add configuration of GoogleAuthenticator /// </summary> /// <param name="customerEmail">Customer email</param> /// <param name="key">Secret key</param> public void AddGoogleAuthenticatorAccount(string customerEmail, string key) { var account = new GoogleAuthenticatorRecord { Customer = customerEmail, SecretKey = key, }; InsertConfiguration(account); }
/// <summary> /// Delete the configuration /// </summary> /// <param name="configuration">Configuration</param> internal async Task DeleteConfigurationAsync(GoogleAuthenticatorRecord configuration) { if (configuration == null) { throw new ArgumentNullException(nameof(configuration)); } await _repository.DeleteAsync(configuration); await _staticCacheManager.RemoveByPrefixAsync(GoogleAuthenticatorDefaults.PrefixCacheKey); }