mirror of
https://github.com/foss42/apidash.git
synced 2025-12-02 18:57:05 +08:00
refactor: update authentication handling to check authData instead of enableAuth flag
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -111,7 +111,6 @@ Future<HttpRequestModel> handleAuth(
|
||||
APIType.rest,
|
||||
authData,
|
||||
httpRequestModel,
|
||||
enableAuth: false,
|
||||
);
|
||||
final httpResponse = httpResult.$1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user