AuthHttpSource constructor
AuthHttpSource({})
Constructor for creating an AuthHttpSource instance.
Initializes the authentication source with user credentials and configurable endpoints. Use the factory constructor AuthHttpSource.inputs for a more fluent interface.
Parameters:
baseUrl: The base URL for API requests (defaults to ApiUrls.BASE_URL if null)email: The user's email address (required)pass: The user's password (required)loginUrl: Custom endpoint for login (defaults to "login")createAccountUrl: Custom endpoint for registration (defaults to "register")logoutUrl: Custom endpoint for logout (defaults to "logout")changePasswordUrl: Custom endpoint for password change (defaults to "change-password")
Implementation
AuthHttpSource({
String? baseUrl = "",
required String this.email,
required String this.pass,
String? loginUrl,
String? createAccountUrl,
String? logoutUrl,
String? changePasswordUrl,
}) {
this.baseUrl = baseUrl ?? ApiUrls.BASE_URL;
this.loginUrl = loginUrl ?? "login";
this.createAccountUrl = createAccountUrl ?? "register";
this.logoutUrl = logoutUrl ?? "logout";
this.changePasswordUrl = changePasswordUrl ?? "change-password";
}