-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: user agent enhancements - part1 cognito (#11324)
* feat: implement new custom user agent details in amazon-cognito-identity-js * chore: update variable name for clearer semantics Co-authored-by: Chris F <5827964+cshfang@users.noreply.github.com> * chore: incorporate PR feedback, fix inconsistent renaming of frameworkHasBeenRerun --------- Co-authored-by: Chris F <5827964+cshfang@users.noreply.github.com>
- Loading branch information
1 parent
65bf314
commit 4f541d2
Showing
7 changed files
with
78 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
packages/amazon-cognito-identity-js/src/Platform/constants.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export const Framework = { | ||
None: '0', | ||
ReactNative: '1', | ||
}; | ||
|
||
export const category = 'auth'; | ||
|
||
// Actions | ||
/* TODO: Replace 'None' with all expected Actions */ | ||
export const AuthAction = { | ||
None: '0', | ||
}; |
10 changes: 10 additions & 0 deletions
10
packages/amazon-cognito-identity-js/src/Platform/detectFramework.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { Framework } from './constants'; | ||
|
||
export const detectFramework = () => { | ||
if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') { | ||
return Framework.ReactNative; | ||
} | ||
return Framework.None; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters