Skip to content

fix: remove credentials when devKeys is set #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "react-native-appwrite",
"homepage": "https://appwrite.io/support",
"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",
"version": "0.9.1",
"version": "0.9.2",
"license": "BSD-3-Clause",
"main": "dist/cjs/sdk.js",
"exports": {
Expand Down
7 changes: 5 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class Client {
'x-sdk-name': 'React Native',
'x-sdk-platform': 'client',
'x-sdk-language': 'reactnative',
'x-sdk-version': '0.9.1',
'x-sdk-version': '0.9.2',
'X-Appwrite-Response-Format': '1.7.0',
};

Expand Down Expand Up @@ -441,9 +441,12 @@ class Client {
let options: RequestInit = {
method,
headers,
credentials: 'include'
};

if (headers['X-Appwrite-Dev-Key'] === undefined) {
options.credentials = 'include';
}

if (method === 'GET') {
for (const [key, value] of Object.entries(Service.flatten(params))) {
url.searchParams.append(key, value);
Expand Down