refactor: update authentication handling to check authData instead of enableAuth flag

This commit is contained in:
Udhay-Adithya
2025-07-06 12:28:35 +05:30
parent c39b8fbe6d
commit 32855fd2f9
2 changed files with 1 additions and 3 deletions

View File

@@ -20,7 +20,6 @@ Future<(HttpResponse?, Duration?, String?)> sendHttpRequest(
HttpRequestModel requestModel, {
SupportedUriSchemes defaultUriScheme = kDefaultUriScheme,
bool noSSL = false,
bool enableAuth = true,
}) async {
if (httpClientManager.wasRequestCancelled(requestId)) {
httpClientManager.removeCancelledRequest(requestId);
@@ -30,7 +29,7 @@ Future<(HttpResponse?, Duration?, String?)> sendHttpRequest(
HttpRequestModel authenticatedRequestModel = requestModel.copyWith();
try {
if (enableAuth) {
if (authData != null && authData.type != APIAuthType.none) {
authenticatedRequestModel = await handleAuth(requestModel, authData);
}
} catch (e) {

View File

@@ -111,7 +111,6 @@ Future<HttpRequestModel> handleAuth(
APIType.rest,
authData,
httpRequestModel,
enableAuth: false,
);
final httpResponse = httpResult.$1;