Skip to content

Conversation

@najuna-brian
Copy link
Contributor

@najuna-brian najuna-brian commented Dec 22, 2025

Description

App bundle downloads fail with 401 errors when switching between servers because the cached authentication token from the previous server is reused.

Solution

  • Clear cached token when server URL changes in getApi()
  • Clear cached token on login to ensure fresh token for new server
  • Added clearTokenCache() public method for explicit cache invalidation

Changes

  • SynkronusApi.getApi(): Clear token cache when server URL changes
  • SynkronusApi.clearTokenCache(): New public method to clear cached token
  • Auth.login(): Clear token cache before logging in

Testing

  • Login to local server → app bundle downloads successfully
  • Switch to demo server → app bundle downloads successfully (no 401 errors)

Closes #111

@najuna-brian najuna-brian merged commit 4da1244 into OpenDataEnsemble:dev Dec 22, 2025
8 checks passed
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.

[Formulus] App Bundle Download Fails with 401 When Switching Servers

2 participants