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(auth): fall back to user agent if deviceName resolves to empty st… #14102

Merged
merged 1 commit into from
Dec 27, 2024

Conversation

cshfang
Copy link
Member

@cshfang cshfang commented Dec 27, 2024

…ring

Description of changes

This PR updates the device name resolution to fall back to using the user agent if it resolves to ''. This might happen when the userAgentData returns empty values for the requested information - something that happens when simulating devices in Chrome, for example.

Currently, the device name already falls back to user agent in the case userAgentData is not supported on the platform so this PR only applies the same fallback logic to the case where userAgentData is supported but is reporting empty values.

Issue #, if available

#14100

Description of how you validated changes

Reproduced issue using Chrome browser and validated that DeviceName is no longer sent with empty string when device tracking is enabled.

Manually tested against Firefox and Safari.

Added unit tests.

Checklist

  • PR description included
  • yarn test passes
  • Unit Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

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

@cshfang cshfang requested review from a team as code owners December 27, 2024 22:09
@cshfang cshfang merged commit 9a73470 into aws-amplify:main Dec 27, 2024
31 checks passed
@cshfang cshfang deleted the fix/add-device-name-fallback branch December 27, 2024 22:57
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.

3 participants