Skip to content

fix: always remove guestIdentityId from keyValueStorage on client-side #14437

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

adrianjoshua-strutt
Copy link
Member

@adrianjoshua-strutt adrianjoshua-strutt commented Jun 19, 2025

Description of changes

Using SSR the guest token in the cookies does not get removed on login. This is because storeIdentityId is called on the server-side before it is called on the client-side, thereby setting _hasGuestIdentityId to false and hindering the client-side to remove the cookie in the browser.

We do not always want to remove the guest identity cookie, because we want to prevent unnecessary cookie deletions when switching between identity types or during credential refreshes. (synced about this with @HuiSF - see #13787)

We fix this by

Issue

#14378

Description of how you validated changes

  1. Ran next.js app provided by costumer
  2. Ran react app to validate that it does not break none SSR flows
  3. e2e tests see: https://github.com/aws-amplify/amplify-js/actions/runs/15782549397

Checklist

  • PR description included
  • yarn test passes
  • Unit Tests are changed

Checklist for repo maintainers

  • Verify E2E tests for existing workflows are working as expected or add E2E tests for newly added workflows

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

soberm
soberm previously approved these changes Jun 19, 2025
ahmedhamouda78
ahmedhamouda78 previously approved these changes Jun 19, 2025
sarayev
sarayev previously approved these changes Jun 19, 2025
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.

5 participants