EmailIdpConfig constructor

const EmailIdpConfig({
  1. required String secretHashPepper,
  2. List<String> fallbackSecretHashPeppers = const [],
  3. Duration registrationVerificationCodeLifetime = const Duration(minutes: 15),
  4. int registrationVerificationCodeAllowedAttempts = 3,
  5. String registrationVerificationCodeGenerator() = defaultVerificationCodeGenerator,
  6. Duration passwordResetVerificationCodeLifetime = const Duration(minutes: 15),
  7. int passwordResetVerificationCodeAllowedAttempts = 3,
  8. String passwordResetVerificationCodeGenerator() = defaultVerificationCodeGenerator,
  9. SendRegistrationVerificationCodeFunction? sendRegistrationVerificationCode,
  10. SendPasswordResetVerificationCodeFunction? sendPasswordResetVerificationCode,
  11. OnPasswordResetCompletedFunction? onPasswordResetCompleted,
  12. RateLimit failedLoginRateLimit = const RateLimit(maxAttempts: 5, timeframe: Duration(minutes: 5)),
  13. PasswordValidationFunction passwordValidationFunction = defaultRegistrationPasswordValidationFunction,
  14. RateLimit maxPasswordResetAttempts = const RateLimit(timeframe: Duration(hours: 1), maxAttempts: 3),
  15. int secretHashSaltLength = 16,
  16. AfterAccountCreatedFunction? onAfterAccountCreated,
})

Create a new email account configuration.

Implementation

const EmailIdpConfig({
  required this.secretHashPepper,
  this.fallbackSecretHashPeppers = const [],
  this.registrationVerificationCodeLifetime = const Duration(minutes: 15),
  this.registrationVerificationCodeAllowedAttempts = 3,
  this.registrationVerificationCodeGenerator =
      defaultVerificationCodeGenerator,
  this.passwordResetVerificationCodeLifetime = const Duration(minutes: 15),
  this.passwordResetVerificationCodeAllowedAttempts = 3,
  this.passwordResetVerificationCodeGenerator =
      defaultVerificationCodeGenerator,
  this.sendRegistrationVerificationCode,
  this.sendPasswordResetVerificationCode,
  this.onPasswordResetCompleted,
  this.failedLoginRateLimit = const RateLimit(
    maxAttempts: 5,
    timeframe: Duration(minutes: 5),
  ),
  this.passwordValidationFunction =
      defaultRegistrationPasswordValidationFunction,
  this.maxPasswordResetAttempts = const RateLimit(
    timeframe: Duration(hours: 1),
    maxAttempts: 3,
  ),
  this.secretHashSaltLength = 16,
  this.onAfterAccountCreated,
});