Skip to content
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

Android: Fixes #11292: Fix unable to sync with multiple Nextcloud accounts in different profiles #11674

Merged
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
9 changes: 9 additions & 0 deletions packages/lib/WebDavApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,15 @@ class WebDavApi {
if (options.path) fetchOptions.path = options.path;
if (body) fetchOptions.body = body;
fetchOptions.ignoreTlsErrors = this.options_.ignoreTlsErrors();
if (shim.mobilePlatform() === 'android') {
// Using credentials = 'omit' prevents authentication cookies from
// being stored. React Native has issues related to cookie authentication:
// https://github.com/facebook/react-native/issues/23185
//
// Auth tokens are passed through the "Authorization" header, so
// these cookies should not be necessary.
fetchOptions.credentials = 'omit';
}
Comment on lines +381 to +389
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: This logic is in WebDavApi.js. As such, this currently affects all WebDAV sync targets.

const url = `${this.baseUrl()}/${ltrimSlashes(path)}`;

if (shim.httpAgent(url)) fetchOptions.agent = shim.httpAgent(url);
Expand Down
Loading