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

Conversation

personalizedrefrigerator
Copy link
Collaborator

Summary

This pull request fixes #11292 by setting preventing React Native from storing cookies when syncing to Nextcloud (see the React Native issue.

Testing plan

  1. Create two profiles, Nextcloud 1 and Nextcloud 2.
  2. Authenticate Nextcloud 2 with a Nextcloud account.
  3. Sync.
  4. Switch to Nextcloud 1 and set up sync with a Nextcloud account on the same domain as Nextcloud 2.
  5. Sync.
  6. Verify that sync completes successfully.
  7. Switch back to Nextcloud 2.
  8. Sync.
  9. Verify that sync completes successfully.

…ookies on Android

Note: An alternative, as suggested on the linked issue, might be to
allow users to manually delete all cookies (e.g. under advanced
settings). This, however, is more complicated (may require either
Android-specific native code or adding a library).
Comment on lines +381 to +389
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';
}
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.

@laurent22 laurent22 merged commit 7627403 into laurent22:dev Jan 18, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android sync sync related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2024-10-30 - Android Joplin Profiles NextCloud Issue
2 participants