copyWith method

BasicAuthenticationConfig copyWith({
  1. Uri loginCredentialsAPIendpoint()?,
  2. Uri signupCredentialsAPIendpoint()?,
  3. FutureOr<AuthenticationData> customLoginResponseParser(
    1. String response
    )?,
  4. FutureOr<User>? customUserMapper(
    1. Map<String, dynamic> userMap
    )?,
  5. Uri refreshTokenAPIendpoint(
    1. String refreshToken,
    2. JWT token
    )?,
  6. bool? debug,
  7. FutureOr<Map<String, dynamic>> customLoginRequestMapper(
    1. String email,
    2. String password,
    3. AuthDeviceInfo? deviceInfo
    )?,
  8. FutureOr<AuthenticationData>? customSignupCredentialsResponseParser(
    1. String response
    )?,
  9. bool? authenticateOnSignup,
  10. AuthCredentialsProvider customAutoSignupAuthClbk(
    1. AuthSignUpPayload payload,
    2. AuthenticationData? authData
    )?,
  11. Uri fetchUserInformationAPIendpoint(
    1. AuthenticationData data
    )?,
  12. FutureOr<Map<String, dynamic>> customFetchUserInformationResponseMapper(
    1. Map<String, dynamic> data
    )?,
  13. bool? initialAuthCheckedAfterUserFetch,
  14. bool? autoLogoutOnSessionExpired,
  15. Duration? maxAge,
  16. FutureOr<AuthenticationTokenParsedData> customRefreshTokenResponseParser(
    1. String body
    )?,
  17. void onRefreshToken(
    1. AuthenticationTokenParsedData tokens
    )?,
  18. String? refreshTokenMethod,
  19. FutureOr<String> customRefreshTokenRequestBodyMapper(
    1. String refreshToken,
    2. String authToken,
    3. AuthDeviceInfo? deviceInfo
    )?,
  20. Duration? refreshTokenTimeout,
  21. void onRefreshTokenFailure(
    1. String token,
    2. Object exception
    )?,
  22. Uri deleteAccountApiEndpoint(
    1. String userId
    )?,
  23. User? deleteAccountCustomResponseParser(
    1. Map<String, dynamic> response
    )?,
  24. bool? logoutAfterDelete,
  25. FutureOr<AuthenticationTokenParsedData> customRefreshTokenCallback(
    1. String token,
    2. String? refreshToken,
    3. AuthDeviceInfo? deviceInfo
    )?,
  26. bool? provideDeviceInfo,
  27. bool customExpiredEventValidatorOnFailure(
    1. Object exception
    )?,
})

Implementation

BasicAuthenticationConfig copyWith({
  Uri Function()? loginCredentialsAPIendpoint,
  Uri Function()? signupCredentialsAPIendpoint,
  FutureOr<AuthenticationData> Function(String response)? customLoginResponseParser,
  FutureOr<User>? Function(Map<String, dynamic> userMap)? customUserMapper,
  Uri Function(String refreshToken, JWT token)? refreshTokenAPIendpoint,
  bool? debug,
  FutureOr<Map<String, dynamic>> Function(String email, String password, AuthDeviceInfo? deviceInfo)?
      customLoginRequestMapper,
  FutureOr<AuthenticationData>? Function(String response)? customSignupCredentialsResponseParser,
  bool? authenticateOnSignup,
  AuthCredentialsProvider Function(AuthSignUpPayload payload, AuthenticationData? authData)? customAutoSignupAuthClbk,
  Uri Function(AuthenticationData data)? fetchUserInformationAPIendpoint,
  FutureOr<Map<String, dynamic>> Function(Map<String, dynamic> data)? customFetchUserInformationResponseMapper,
  bool? initialAuthCheckedAfterUserFetch,
  bool? autoLogoutOnSessionExpired,
  Duration? maxAge,
  FutureOr<AuthenticationTokenParsedData> Function(String body)? customRefreshTokenResponseParser,
  void Function(AuthenticationTokenParsedData tokens)? onRefreshToken,
  String? refreshTokenMethod,
  FutureOr<String> Function(String refreshToken, String authToken, AuthDeviceInfo? deviceInfo)?
      customRefreshTokenRequestBodyMapper,
  Duration? refreshTokenTimeout,
  void Function(String token, Object exception)? onRefreshTokenFailure,
  Uri Function(String userId)? deleteAccountApiEndpoint,
  User? Function(Map<String, dynamic> response)? deleteAccountCustomResponseParser,
  bool? logoutAfterDelete,
  FutureOr<AuthenticationTokenParsedData> Function(String token, String? refreshToken, AuthDeviceInfo? deviceInfo)?
      customRefreshTokenCallback,
  bool? provideDeviceInfo,
  bool Function(Object exception)? customExpiredEventValidatorOnFailure,
}) {
  return BasicAuthenticationConfig(
    loginCredentialsAPIendpoint: loginCredentialsAPIendpoint ?? this.loginCredentialsAPIendpoint,
    signupCredentialsAPIendpoint: signupCredentialsAPIendpoint ?? this.signupCredentialsAPIendpoint,
    customLoginResponseParser: customLoginResponseParser ?? this.customLoginResponseParser,
    customUserMapper: customUserMapper ?? this.customUserMapper,
    refreshTokenAPIendpoint: refreshTokenAPIendpoint ?? this.refreshTokenAPIendpoint,
    debug: debug ?? this.debug,
    customLoginRequestMapper: customLoginRequestMapper ?? this.customLoginRequestMapper,
    customSignupCredentialsResponseParser:
        customSignupCredentialsResponseParser ?? this.customSignupCredentialsResponseParser,
    authenticateOnSignup: authenticateOnSignup ?? this.authenticateOnSignup,
    customAutoSignupAuthClbk: customAutoSignupAuthClbk ?? this.customAutoSignupAuthClbk,
    fetchUserInformationAPIendpoint: fetchUserInformationAPIendpoint ?? this.fetchUserInformationAPIendpoint,
    customFetchUserInformationResponseMapper:
        customFetchUserInformationResponseMapper ?? this.customFetchUserInformationResponseMapper,
    initialAuthCheckedAfterUserFetch: initialAuthCheckedAfterUserFetch ?? this.initialAuthCheckedAfterUserFetch,
    autoLogoutOnSessionExpired: autoLogoutOnSessionExpired ?? this.autoLogoutOnSessionExpired,
    maxAge: maxAge ?? this.maxAge,
    customRefreshTokenResponseParser: customRefreshTokenResponseParser ?? this.customRefreshTokenResponseParser,
    onRefreshToken: onRefreshToken ?? this.onRefreshToken,
    refreshTokenMethod: refreshTokenMethod ?? this.refreshTokenMethod,
    customRefreshTokenRequestBodyMapper: customRefreshTokenRequestBodyMapper ?? this.customRefreshTokenRequestBodyMapper,
    refreshTokenTimeout: refreshTokenTimeout ?? this.refreshTokenTimeout,
    onRefreshTokenFailure: onRefreshTokenFailure ?? this.onRefreshTokenFailure,
    deleteAccountApiEndpoint: deleteAccountApiEndpoint ?? this.deleteAccountApiEndpoint,
    deleteAccountCustomResponseParser: deleteAccountCustomResponseParser ?? this.deleteAccountCustomResponseParser,
    logoutAfterDelete: logoutAfterDelete ?? this.logoutAfterDelete,
    customRefreshTokenCallback: customRefreshTokenCallback ?? this.customRefreshTokenCallback,
    provideDeviceInfo: provideDeviceInfo ?? this.provideDeviceInfo,
    customExpiredEventValidatorOnFailure:
        customExpiredEventValidatorOnFailure ?? this.customExpiredEventValidatorOnFailure,
  );
}