Skip to content

Conversation

@mattcreaser
Copy link
Member

  • PR title and description conform to Pull Request guidelines.

Issue #, if available:

Description of changes:

Use the cached user id (this is the "sub" from cognito) and username when invoking getCurrentUser instead of trying to fetch and parse a new access token.

This fixes a bug where getCurrentUser returns an error if the device is offline and the access token is expired. The user is still considered "signed in" in this scenario, however, so failing to return the current user is incongruent behaviour.

How did you test these changes?

  • Reproduced bug before fix, verified it does not occur after fix
  • Unit tests

Documentation update required?

  • No
  • Yes (Please include a PR link for the documentation update)

General Checklist

  • Added Unit Tests
  • Added Integration Tests
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)

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

…urrentUser

This fixes a bug where getCurrentUser returns an error if the device is offline and the access token is expired. The user is still considered "signed in" in this scenario, however, so failing to return the current user is incongruent behaviour
tylerjroach
tylerjroach previously approved these changes Feb 12, 2025
@mattcreaser mattcreaser enabled auto-merge (squash) February 13, 2025 18:48
@mattcreaser mattcreaser merged commit f567b4b into main Feb 13, 2025
3 checks passed
@mattcreaser mattcreaser deleted the mattcreaser/fix-get-current-user-offline branch February 13, 2025 18:55
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.

2 participants