File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
templates/flutter/lib/src Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,6 @@ class ClientBrowser extends ClientBase with ClientMixin {
112
112
if (cookieFallback != null) {
113
113
addHeader('x-fallback-cookies', cookieFallback);
114
114
}
115
- _httpClient.withCredentials = true;
116
115
}
117
116
118
117
@override
@@ -192,11 +191,21 @@ class ClientBrowser extends ClientBase with ClientMixin {
192
191
}) async {
193
192
await init();
194
193
194
+ // Combine headers to check for dev key
195
+ final combinedHeaders = {..._headers!, ...headers};
196
+
197
+ // Only include credentials when dev key is not set
198
+ if (combinedHeaders['X-Appwrite-Dev-Key'] == null) {
199
+ _httpClient.withCredentials = true;
200
+ } else {
201
+ _httpClient.withCredentials = false;
202
+ }
203
+
195
204
late http.Response res;
196
205
http.BaseRequest request = prepareRequest(
197
206
method,
198
207
uri: Uri.parse(_endPoint + path),
199
- headers: {..._headers!, ...headers} ,
208
+ headers: combinedHeaders ,
200
209
params: params,
201
210
);
202
211
try {
You can’t perform that action at this time.
0 commit comments