Skip to content

fix(android): preserve session cookies during login - #169

Open
abdulnourwa wants to merge 1 commit into
Sathvik-Rao:mainfrom
abdulnourwa:fix/android-login-cookie-handling
Open

fix(android): preserve session cookies during login#169
abdulnourwa wants to merge 1 commit into
Sathvik-Rao:mainfrom
abdulnourwa:fix/android-login-cookie-handling

Conversation

@abdulnourwa

Copy link
Copy Markdown

Summary

I reproduced the Android login failure reported in #144 against a self-hosted server behind an HTTPS reverse proxy.

The server was returning a valid session cookie, but the Android client required the Set-Cookie header to be readable from JavaScript and then copied that response header into the next request. React Native already stores response cookies in Android's native cookie jar, so login should use that stored cookie directly.

This change:

  • lets React Native retain and send the session cookie
  • removes the JavaScript Set-Cookie check and manual Cookie header
  • waits for cookie cleanup to finish before login continues
  • waits for cookie cleanup when logging out

Waiting for cookie removal also prevents an unfinished cleanup operation from deleting a newly created login session.

Testing

  • built the Android debug APK successfully
  • generated the production Android JavaScript bundle successfully
  • tested login, session restoration, logout, and login again on an Android device
  • verified clipboard syncing still starts after authentication

Fixes #144

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cant get it to work behind Nginx proxy: No Set-Cookie header returned from login page

1 participant