AuthenticationFireSocialConfig constructor

AuthenticationFireSocialConfig({
  1. required Uri loginCredentialsAPIendpoint(),
  2. required 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 = false,
  7. FutureOr<Map<String, dynamic>> customLoginRequestMapper(
    1. String email,
    2. String password,
    3. AuthDeviceInfo? deviceInfo
    )?,
  8. FutureOr<AuthenticationData>? customSignupCredentialsResponseParser(
    1. String body
    )?,
  9. bool authenticateOnSignup = true,
  10. FutureOr<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 = true,
  14. bool autoLogoutOnSessionExpired = true,
  15. Duration? maxAge,
  16. FutureOr<Map<String, String>> customRefreshTokenResponseParser(
    1. String body
    )?,
  17. void onRefreshToken(
    1. Map<String, String> 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. required Uri deleteAccountApiEndpoint(
    1. String userId
    ),
  23. User? deleteAccountCustomResponseParser(
    1. Map<String, dynamic> response
    )?,
  24. bool logoutAfterDelete = true,
  25. FutureOr<Map<String, String>> customRefreshTokenCallback(
    1. String token,
    2. String? refreshToken,
    3. AuthDeviceInfo? deviceInfo
    )?,
  26. Uri authenticateAppleAPIendpoint(
    1. SocialProviderResponse socialData
    )?,
  27. Uri authenticateFacebookAPIendpoint(
    1. SocialProviderResponse socialData
    )?,
  28. Uri authenticateGoogleAPIendpoint(
    1. SocialProviderResponse socialData
    )?,
  29. Uri authenticateAnonymouslyAPIendpoint(
    1. SocialProviderResponse socialData
    )?,
  30. Uri setupUserFieldsAPIendpoint(
    1. AuthenticationData authenticationData
    )?,
  31. FutureOr<Map<String, String>> customAuthenticationAppleRequestMapper(
    1. SocialProviderResponse socialData,
    2. AuthDeviceInfo? authDeviceInfo
    )?,
  32. FutureOr<Map<String, String>> customAuthenticationFacebookRequestMapper(
    1. SocialProviderResponse socialData,
    2. AuthDeviceInfo? authDeviceInfo
    )?,
  33. FutureOr<Map<String, String>> customAuthenticationGoogleRequestMapper(
    1. SocialProviderResponse socialData,
    2. AuthDeviceInfo? authDeviceInfo
    )?,
  34. FutureOr<Map<String, String>> customAuthenticationAnonymousRequestMapper(
    1. SocialProviderResponse socialData,
    2. AuthDeviceInfo? authDeviceInfo
    )?,
  35. FutureOr<Map<String, String>> customSetupFieldsUserRequestMapper(
    1. AuthSignUpPayload payload,
    2. AuthenticationData authData
    )?,
  36. FutureOr<AuthenticationData> customAuthenticationGoogleResponseParser(
    1. String response
    )?,
  37. FutureOr<AuthenticationData> customAuthenticationAppleResponseParser(
    1. String response
    )?,
  38. FutureOr<AuthenticationData> customAuthenticationFacebookResponseParser(
    1. String response
    )?,
  39. FutureOr<AuthenticationData> customAuthenticationAnonymousResponseParser(
    1. String response
    )?,
  40. FutureOr<AuthenticationData> customSetupFieldsUserResponseParser(
    1. String response
    )?,
  41. bool shouldDeleteOnFirebase = false,
})

Implementation

AuthenticationFireSocialConfig({
  required super.loginCredentialsAPIendpoint,
  required super.signupCredentialsAPIendpoint,
  super.customLoginResponseParser,
  super.customUserMapper,
  super.refreshTokenAPIendpoint,
  super.debug = false,
  super.customLoginRequestMapper,
  super.customSignupCredentialsResponseParser,
  super.authenticateOnSignup = true,
  super.customAutoSignupAuthClbk,
  super.fetchUserInformationAPIendpoint,
  super.customFetchUserInformationResponseMapper,
  super.initialAuthCheckedAfterUserFetch = true,
  super.autoLogoutOnSessionExpired = true,
  super.maxAge,
  super.customRefreshTokenResponseParser,
  super.onRefreshToken,
  super.refreshTokenMethod,
  super.customRefreshTokenRequestBodyMapper,
  super.refreshTokenTimeout,
  super.onRefreshTokenFailure,
  required super.deleteAccountApiEndpoint,
  super.deleteAccountCustomResponseParser,
  super.logoutAfterDelete,
  super.customRefreshTokenCallback,
  // own class props
  this.authenticateAppleAPIendpoint,
  this.authenticateFacebookAPIendpoint,
  this.authenticateGoogleAPIendpoint,
  this.authenticateAnonymouslyAPIendpoint,
  this.setupUserFieldsAPIendpoint,
  this.customAuthenticationAppleRequestMapper,
  this.customAuthenticationFacebookRequestMapper,
  this.customAuthenticationGoogleRequestMapper,
  this.customAuthenticationAnonymousRequestMapper,
  this.customSetupFieldsUserRequestMapper,
  this.customAuthenticationGoogleResponseParser,
  this.customAuthenticationAppleResponseParser,
  this.customAuthenticationFacebookResponseParser,
  this.customAuthenticationAnonymousResponseParser,
  this.customSetupFieldsUserResponseParser,
  this.shouldDeleteOnFirebase = false,
}) {
  if (authenticateAppleAPIendpoint == null &&
      authenticateFacebookAPIendpoint == null &&
      authenticateGoogleAPIendpoint == null &&
      authenticateAnonymouslyAPIendpoint == null) {
    throw InvalidAdvancedAuthConfigurationException(
      "You must specify at least one social endpoint of: [authenticateAppleAPIendpoint, authenticateFacebookAPIendpoint, authenticateGoogleAPIendpoint, authenticateAnonymouslyAPIendpoint]",
    );
  }
}