diff --git a/README.md b/README.md index 516536e..dee8871 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Add this to your package's `pubspec.yaml` file: ```yml dependencies: - appwrite: ^17.0.0 + appwrite: ^17.0.1 ``` You can install packages from the command line: diff --git a/lib/src/client_browser.dart b/lib/src/client_browser.dart index 6a1b624..48cb897 100644 --- a/lib/src/client_browser.dart +++ b/lib/src/client_browser.dart @@ -40,7 +40,7 @@ class ClientBrowser extends ClientBase with ClientMixin { 'x-sdk-name': 'Flutter', 'x-sdk-platform': 'client', 'x-sdk-language': 'flutter', - 'x-sdk-version': '17.0.0', + 'x-sdk-version': '17.0.1', 'X-Appwrite-Response-Format': '1.7.0', }; @@ -136,7 +136,6 @@ class ClientBrowser extends ClientBase with ClientMixin { if (cookieFallback != null) { addHeader('x-fallback-cookies', cookieFallback); } - _httpClient.withCredentials = true; } @override @@ -227,11 +226,21 @@ class ClientBrowser extends ClientBase with ClientMixin { }) async { await init(); + // Combine headers to check for dev key + final combinedHeaders = {..._headers!, ...headers}; + + // Only include credentials when dev key is not set + if (combinedHeaders['X-Appwrite-Dev-Key'] == null) { + _httpClient.withCredentials = true; + } else { + _httpClient.withCredentials = false; + } + late http.Response res; http.BaseRequest request = prepareRequest( method, uri: Uri.parse(_endPoint + path), - headers: {..._headers!, ...headers}, + headers: combinedHeaders, params: params, ); try { diff --git a/lib/src/client_io.dart b/lib/src/client_io.dart index 676caac..d6b0e70 100644 --- a/lib/src/client_io.dart +++ b/lib/src/client_io.dart @@ -58,7 +58,7 @@ class ClientIO extends ClientBase with ClientMixin { 'x-sdk-name': 'Flutter', 'x-sdk-platform': 'client', 'x-sdk-language': 'flutter', - 'x-sdk-version': '17.0.0', + 'x-sdk-version': '17.0.1', 'X-Appwrite-Response-Format': '1.7.0', }; diff --git a/pubspec.yaml b/pubspec.yaml index 13b9b15..3c6850c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: appwrite -version: 17.0.0 +version: 17.0.1 description: Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API homepage: https://appwrite.io repository: https://github.com/appwrite/sdk-for-flutter