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

fix: signout bug when offline #6061

Merged
merged 7 commits into from
Feb 21, 2025
Merged

Conversation

dehli
Copy link
Contributor

@dehli dehli commented Nov 12, 2024

Description of changes

If you call Auth.fetchAuthSession({ forceRefresh: true }) while offline and using the Authenticator, amplify-ui will trigger the logout flow. This fixes that bug.

Issue #6057, if available

Description of how you validated changes

Added a test and used patch-package.

This is the related amplify-js code:

https://github.com/aws-amplify/amplify-js/blob/0f5091780046b9556b98300c29fb970a0358bd70/packages/auth/src/providers/cognito/tokenProvider/TokenOrchestrator.ts#L173-L176

image

Checklist

  • Have read the Pull Request Guidelines
  • PR description included
  • yarn test passes and tests are updated/added (when running locally they seem to run infinitely but I did add a test)
  • PR title and commit messages follow conventional commit syntax
  • If this change should result in a version bump, changeset added (This can be done after creating the PR.) This does not apply to changes made to docs, e2e, examples, or other private packages.

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

@dehli dehli requested a review from a team as a code owner November 12, 2024 10:50
Copy link

changeset-bot bot commented Nov 12, 2024

⚠️ No Changeset found

Latest commit: 001d09c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dehli dehli force-pushed the dev/dehli/fix-6057 branch from c378277 to 5051b6e Compare November 12, 2024 17:21
@dehli
Copy link
Contributor Author

dehli commented Dec 30, 2024

Bump. Been using this myself and it has addressed the sign-out bug we were previously experiencing.

@LukaASoban
Copy link

Bump - would love to see this fix go in as it is affecting all of our users

@calebpollman
Copy link
Member

@dehli Thanks for opening this, fix looks straightforward. Will give it a full review in the next day or so

Copy link
Member

@calebpollman calebpollman left a comment

Choose a reason for hiding this comment

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

@dehli LGTM, just left a small suggestion. Thanks for cleaning up the typos

@dehli
Copy link
Contributor Author

dehli commented Jan 28, 2025

Thanks for feedback, @calebpollman! Added it as a follow-up commit. Let me know if you'd like me to squash them.

@calebpollman calebpollman added run-tests Adding this label will trigger tests to run and removed run-tests Adding this label will trigger tests to run labels Jan 28, 2025
@calebpollman
Copy link
Member

Thanks for feedback, @calebpollman! Added it as a follow-up commit. Let me know if you'd like me to squash them.

Thanks for addressing the feedback, no need to worry abt squashing - we'll handle that on our end

@calebpollman
Copy link
Member

See #6367 for passing e2e tests

@calebpollman calebpollman merged commit 045aa57 into aws-amplify:main Feb 21, 2025
28 checks passed
calebpollman added a commit that referenced this pull request Feb 21, 2025
@calebpollman calebpollman mentioned this pull request Feb 21, 2025
4 tasks
calebpollman added a commit that referenced this pull request Feb 21, 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.

4 participants