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 {
112112 if (cookieFallback != null) {
113113 addHeader('x-fallback-cookies', cookieFallback);
114114 }
115- _httpClient.withCredentials = true;
116115 }
117116
118117 @override
@@ -192,11 +191,21 @@ class ClientBrowser extends ClientBase with ClientMixin {
192191 }) async {
193192 await init();
194193
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+
195204 late http.Response res;
196205 http.BaseRequest request = prepareRequest(
197206 method,
198207 uri: Uri.parse(_endPoint + path),
199- headers: {..._headers!, ...headers} ,
208+ headers: combinedHeaders ,
200209 params: params,
201210 );
202211 try {
You can’t perform that action at this time.
0 commit comments