@aws-amplify/auth 4.6.2-next.36 → 4.6.2-next.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/lib/Auth.d.ts +2 -0
  2. package/lib/Auth.js +150 -155
  3. package/lib/Auth.js.map +1 -1
  4. package/lib/Errors.js +2 -12
  5. package/lib/Errors.js.map +1 -1
  6. package/lib/OAuth/OAuth.js +2 -12
  7. package/lib/OAuth/OAuth.js.map +1 -1
  8. package/lib/OAuth/oauthStorage.js +2 -12
  9. package/lib/OAuth/oauthStorage.js.map +1 -1
  10. package/lib/OAuth/oauthStorage.native.js +2 -12
  11. package/lib/OAuth/oauthStorage.native.js.map +1 -1
  12. package/lib/OAuth/urlOpener.js +2 -12
  13. package/lib/OAuth/urlOpener.js.map +1 -1
  14. package/lib/OAuth/urlOpener.native.js +2 -12
  15. package/lib/OAuth/urlOpener.native.js.map +1 -1
  16. package/lib/index.js +2 -12
  17. package/lib/index.js.map +1 -1
  18. package/lib/types/Auth.js +2 -12
  19. package/lib/types/Auth.js.map +1 -1
  20. package/lib/types/index.js +2 -12
  21. package/lib/types/index.js.map +1 -1
  22. package/lib/urlListener.js +2 -12
  23. package/lib/urlListener.js.map +1 -1
  24. package/lib/urlListener.native.js +2 -12
  25. package/lib/urlListener.native.js.map +1 -1
  26. package/lib-esm/Auth.d.ts +2 -0
  27. package/lib-esm/Auth.js +150 -155
  28. package/lib-esm/Auth.js.map +1 -1
  29. package/lib-esm/Errors.js +2 -12
  30. package/lib-esm/Errors.js.map +1 -1
  31. package/lib-esm/OAuth/OAuth.js +2 -12
  32. package/lib-esm/OAuth/OAuth.js.map +1 -1
  33. package/lib-esm/OAuth/oauthStorage.js +2 -12
  34. package/lib-esm/OAuth/oauthStorage.js.map +1 -1
  35. package/lib-esm/OAuth/oauthStorage.native.js +2 -12
  36. package/lib-esm/OAuth/oauthStorage.native.js.map +1 -1
  37. package/lib-esm/OAuth/urlOpener.js +2 -12
  38. package/lib-esm/OAuth/urlOpener.js.map +1 -1
  39. package/lib-esm/OAuth/urlOpener.native.js +2 -12
  40. package/lib-esm/OAuth/urlOpener.native.js.map +1 -1
  41. package/lib-esm/index.js +2 -12
  42. package/lib-esm/index.js.map +1 -1
  43. package/lib-esm/types/Auth.js +2 -12
  44. package/lib-esm/types/Auth.js.map +1 -1
  45. package/lib-esm/types/index.js +2 -12
  46. package/lib-esm/types/index.js.map +1 -1
  47. package/lib-esm/urlListener.js +2 -12
  48. package/lib-esm/urlListener.js.map +1 -1
  49. package/lib-esm/urlListener.native.js +2 -12
  50. package/lib-esm/urlListener.native.js.map +1 -1
  51. package/package.json +4 -5
  52. package/src/Auth.ts +109 -124
  53. package/src/Errors.ts +2 -12
  54. package/src/OAuth/OAuth.ts +2 -12
  55. package/src/OAuth/oauthStorage.native.ts +2 -12
  56. package/src/OAuth/oauthStorage.ts +2 -12
  57. package/src/OAuth/urlOpener.native.ts +2 -12
  58. package/src/OAuth/urlOpener.ts +2 -12
  59. package/src/index.ts +2 -12
  60. package/src/types/Auth.ts +2 -12
  61. package/src/types/index.ts +2 -12
  62. package/src/urlListener.native.ts +2 -12
  63. package/src/urlListener.ts +2 -12
@@ -1 +1 @@
1
- {"version":3,"file":"urlListener.native.js","sourceRoot":"","sources":["../src/urlListener.native.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC5D,IAAM,MAAM,GAAG,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC;AAEzC,IAAI,OAAO,CAAC;AAEZ,gBAAe,UAAM,QAAQ;;;;;QAC5B,IAAI,OAAO,EAAE;YACZ,sBAAO;SACP;QAKD,IAAI;YACH,CAAC,4BAA+C,EAA7C,oBAAO,EAAE,sBAAQ,CAA6B,CAAC;SAClD;QAAC,OAAO,KAAK,EAAE;YACf,wBAAwB;SACxB;QAED,OAAO;YACN,OAAO;gBACP,CAAC,UAAC,EAAiC;oBAA/B,IAAA,YAAG,EAAE,0BAAO;oBACf,MAAM,CAAC,KAAK,CAAC,aAAa,aAAI,GAAG,KAAA,IAAK,IAAI,EAAG,CAAC;oBAC9C,QAAQ,CAAC,EAAE,GAAG,KAAA,EAAE,CAAC,CAAC;gBACnB,CAAC,CAAC,CAAC;QAEJ,oGAAoG;QACpG,IAAI,OAAO,CAAC,mBAAmB,KAAK,OAAO,UAAU,EAAE;YACtD,OAAO,CAAC,mBAAmB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YAC5C,OAAO,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;SACzC;aAAM;YACN,kDAAkD;YAClD,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,MAAM,+CAApB,YAAY,EAAa;YACzB,YAAY,GAAG,OAAO,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;SACxD;QACD,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,UAAM,WAAW;;;;;6BAChD,CAAA,WAAW,KAAK,QAAQ,CAAA,EAAxB,wBAAwB;wBACR,qBAAM,OAAO,CAAC,aAAa,EAAE,EAAA;;wBAA1C,UAAU,GAAG,SAA6B;wBAChD,OAAO,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,CAAC;;;;;aAE9B,CAAC,CAAC;;;KACH,EAAC"}
1
+ {"version":3,"file":"urlListener.native.js","sourceRoot":"","sources":["../src/urlListener.native.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC5D,IAAM,MAAM,GAAG,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC;AAEzC,IAAI,OAAO,CAAC;AAEZ,gBAAe,UAAM,QAAQ;;;;;QAC5B,IAAI,OAAO,EAAE;YACZ,sBAAO;SACP;QAKD,IAAI;YACH,CAAC,4BAA+C,EAA7C,oBAAO,EAAE,sBAAQ,CAA6B,CAAC;SAClD;QAAC,OAAO,KAAK,EAAE;YACf,wBAAwB;SACxB;QAED,OAAO;YACN,OAAO;gBACP,CAAC,UAAC,EAAiC;oBAA/B,IAAA,YAAG,EAAE,0BAAO;oBACf,MAAM,CAAC,KAAK,CAAC,aAAa,aAAI,GAAG,KAAA,IAAK,IAAI,EAAG,CAAC;oBAC9C,QAAQ,CAAC,EAAE,GAAG,KAAA,EAAE,CAAC,CAAC;gBACnB,CAAC,CAAC,CAAC;QAEJ,oGAAoG;QACpG,IAAI,OAAO,CAAC,mBAAmB,KAAK,OAAO,UAAU,EAAE;YACtD,OAAO,CAAC,mBAAmB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YAC5C,OAAO,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;SACzC;aAAM;YACN,kDAAkD;YAClD,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,MAAM,+CAApB,YAAY,EAAa;YACzB,YAAY,GAAG,OAAO,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;SACxD;QACD,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,UAAM,WAAW;;;;;6BAChD,CAAA,WAAW,KAAK,QAAQ,CAAA,EAAxB,wBAAwB;wBACR,qBAAM,OAAO,CAAC,aAAa,EAAE,EAAA;;wBAA1C,UAAU,GAAG,SAA6B;wBAChD,OAAO,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,CAAC;;;;;aAE9B,CAAC,CAAC;;;KACH,EAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/auth",
3
- "version": "4.6.2-next.36+580cda186",
3
+ "version": "4.6.2-next.41+f6ee89f54",
4
4
  "description": "Auth category of aws-amplify",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib-esm/index.js",
@@ -47,9 +47,8 @@
47
47
  "src"
48
48
  ],
49
49
  "dependencies": {
50
- "@aws-amplify/cache": "4.0.51-next.36+580cda186",
51
- "@aws-amplify/core": "4.6.2-next.36+580cda186",
52
- "amazon-cognito-identity-js": "5.2.11-next.60+580cda186",
50
+ "@aws-amplify/core": "4.6.2-next.41+f6ee89f54",
51
+ "amazon-cognito-identity-js": "5.2.11-next.65+f6ee89f54",
53
52
  "crypto-js": "^4.1.1",
54
53
  "tslib": "^2.0.0"
55
54
  },
@@ -102,5 +101,5 @@
102
101
  ],
103
102
  "testSequencer": "./testSequencer.js"
104
103
  },
105
- "gitHead": "580cda186f10ead3bb99acb7a4825c435c657d33"
104
+ "gitHead": "f6ee89f54b4176f680529bfdb7205b3a29cf3be2"
106
105
  }
package/src/Auth.ts CHANGED
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  import {
15
5
  AuthOptions,
@@ -112,7 +102,7 @@ export class AuthClass {
112
102
  private oAuthFlowInProgress: boolean = false;
113
103
  private pendingSignIn: ReturnType<AuthClass['signInWithPassword']> | null;
114
104
  private autoSignInInitiated: boolean = false;
115
-
105
+ private inflightSessionPromise: Promise<CognitoUserSession> | null = null;
116
106
  Credentials = Credentials;
117
107
 
118
108
  /**
@@ -1629,90 +1619,71 @@ export class AuthClass {
1629
1619
  return;
1630
1620
  }
1631
1621
 
1632
- const clientMetadata = this._config.clientMetadata; // TODO: verify behavior if this is override during signIn
1633
-
1634
1622
  // refresh the session if the session expired.
1635
- user.getSession(
1636
- async (err, session) => {
1637
- if (err) {
1638
- logger.debug('Failed to get the user session', err);
1639
- if (this.isSessionInvalid(err)) {
1640
- try {
1641
- await this.cleanUpInvalidSession(user);
1642
- } catch (cleanUpError) {
1643
- rej(
1644
- new Error(
1645
- `Session is invalid due to: ${err.message} and failed to clean up invalid session: ${cleanUpError.message}`
1646
- )
1647
- );
1648
- return;
1649
- }
1650
- }
1651
- rej(err);
1652
- return;
1653
- }
1623
+ try {
1624
+ const session = await this._userSession(user);
1654
1625
 
1655
- // get user data from Cognito
1656
- const bypassCache = params ? params.bypassCache : false;
1626
+ // get user data from Cognito
1627
+ const bypassCache = params ? params.bypassCache : false;
1657
1628
 
1658
- if (bypassCache) {
1659
- await this.Credentials.clear();
1660
- }
1629
+ if (bypassCache) {
1630
+ await this.Credentials.clear();
1631
+ }
1661
1632
 
1662
- const clientMetadata = this._config.clientMetadata; // TODO: verify behavior if this is override during signIn
1663
-
1664
- // validate the token's scope first before calling this function
1665
- const { scope = '' } = session.getAccessToken().decodePayload();
1666
- if (scope.split(' ').includes(USER_ADMIN_SCOPE)) {
1667
- user.getUserData(
1668
- async (err, data) => {
1669
- if (err) {
1670
- logger.debug('getting user data failed', err);
1671
- if (this.isSessionInvalid(err)) {
1672
- try {
1673
- await this.cleanUpInvalidSession(user);
1674
- } catch (cleanUpError) {
1675
- rej(
1676
- new Error(
1677
- `Session is invalid due to: ${err.message} and failed to clean up invalid session: ${cleanUpError.message}`
1678
- )
1679
- );
1680
- return;
1681
- }
1682
- rej(err);
1683
- } else {
1684
- res(user);
1633
+ const clientMetadata = this._config.clientMetadata;
1634
+
1635
+ // validate the token's scope first before calling this function
1636
+ const { scope = '' } = session.getAccessToken().decodePayload();
1637
+ if (scope.split(' ').includes(USER_ADMIN_SCOPE)) {
1638
+ user.getUserData(
1639
+ async (err, data) => {
1640
+ if (err) {
1641
+ logger.debug('getting user data failed', err);
1642
+ if (this.isSessionInvalid(err)) {
1643
+ try {
1644
+ await this.cleanUpInvalidSession(user);
1645
+ } catch (cleanUpError) {
1646
+ rej(
1647
+ new Error(
1648
+ `Session is invalid due to: ${err.message} and failed to clean up invalid session: ${cleanUpError.message}`
1649
+ )
1650
+ );
1651
+ return;
1685
1652
  }
1686
- return;
1687
- }
1688
- const preferredMFA = data.PreferredMfaSetting || 'NOMFA';
1689
- const attributeList = [];
1690
-
1691
- for (let i = 0; i < data.UserAttributes.length; i++) {
1692
- const attribute = {
1693
- Name: data.UserAttributes[i].Name,
1694
- Value: data.UserAttributes[i].Value,
1695
- };
1696
- const userAttribute = new CognitoUserAttribute(attribute);
1697
- attributeList.push(userAttribute);
1653
+ rej(err);
1654
+ } else {
1655
+ res(user);
1698
1656
  }
1657
+ return;
1658
+ }
1659
+ const preferredMFA = data.PreferredMfaSetting || 'NOMFA';
1660
+ const attributeList = [];
1661
+
1662
+ for (let i = 0; i < data.UserAttributes.length; i++) {
1663
+ const attribute = {
1664
+ Name: data.UserAttributes[i].Name,
1665
+ Value: data.UserAttributes[i].Value,
1666
+ };
1667
+ const userAttribute = new CognitoUserAttribute(attribute);
1668
+ attributeList.push(userAttribute);
1669
+ }
1699
1670
 
1700
- const attributes = this.attributesToObject(attributeList);
1701
- Object.assign(user, { attributes, preferredMFA });
1702
- return res(user);
1703
- },
1704
- { bypassCache, clientMetadata }
1705
- );
1706
- } else {
1707
- logger.debug(
1708
- `Unable to get the user data because the ${USER_ADMIN_SCOPE} ` +
1709
- `is not in the scopes of the access token`
1710
- );
1711
- return res(user);
1712
- }
1713
- },
1714
- { clientMetadata }
1715
- );
1671
+ const attributes = this.attributesToObject(attributeList);
1672
+ Object.assign(user, { attributes, preferredMFA });
1673
+ return res(user);
1674
+ },
1675
+ { bypassCache, clientMetadata }
1676
+ );
1677
+ } else {
1678
+ logger.debug(
1679
+ `Unable to get the user data because the ${USER_ADMIN_SCOPE} ` +
1680
+ `is not in the scopes of the access token`
1681
+ );
1682
+ return res(user);
1683
+ }
1684
+ } catch (err) {
1685
+ rej(err);
1686
+ }
1716
1687
  })
1717
1688
  .catch(e => {
1718
1689
  logger.debug('Failed to sync cache info into memory', e);
@@ -1816,47 +1787,61 @@ export class AuthClass {
1816
1787
  });
1817
1788
  }
1818
1789
 
1819
- /**
1820
- * Get the corresponding user session
1821
- * @param {Object} user - The CognitoUser object
1822
- * @return - A promise resolves to the session
1823
- */
1824
- public userSession(user): Promise<CognitoUserSession> {
1790
+ private async _userSession(user?: CognitoUser): Promise<CognitoUserSession> {
1825
1791
  if (!user) {
1826
1792
  logger.debug('the user is null');
1827
1793
  return this.rejectAuthError(AuthErrorTypes.NoUserSession);
1828
1794
  }
1829
- const clientMetadata = this._config.clientMetadata; // TODO: verify behavior if this is override during signIn
1830
-
1831
- return new Promise((res, rej) => {
1832
- logger.debug('Getting the session from this user:', user);
1833
- user.getSession(
1834
- async (err, session) => {
1835
- if (err) {
1836
- logger.debug('Failed to get the session from user', user);
1837
- if (this.isSessionInvalid(err)) {
1838
- try {
1839
- await this.cleanUpInvalidSession(user);
1840
- } catch (cleanUpError) {
1841
- rej(
1842
- new Error(
1843
- `Session is invalid due to: ${err.message} and failed to clean up invalid session: ${cleanUpError.message}`
1844
- )
1845
- );
1795
+ const clientMetadata = this._config.clientMetadata;
1796
+ // Debouncing the concurrent userSession calls by caching the promise.
1797
+ // This solution asumes users will always call this function with the same CognitoUser instance.
1798
+ if (!this.inflightSessionPromise) {
1799
+ this.inflightSessionPromise = new Promise<CognitoUserSession>(
1800
+ (res, rej) => {
1801
+ user.getSession(
1802
+ async (err, session) => {
1803
+ if (err) {
1804
+ logger.debug('Failed to get the session from user', user);
1805
+ if (this.isSessionInvalid(err)) {
1806
+ try {
1807
+ await this.cleanUpInvalidSession(user);
1808
+ } catch (cleanUpError) {
1809
+ rej(
1810
+ new Error(
1811
+ `Session is invalid due to: ${err.message} and failed to clean up invalid session: ${cleanUpError.message}`
1812
+ )
1813
+ );
1814
+ return;
1815
+ }
1816
+ }
1817
+ rej(err);
1818
+ return;
1819
+ } else {
1820
+ logger.debug('Succeed to get the user session', session);
1821
+ res(session);
1846
1822
  return;
1847
1823
  }
1848
- }
1849
- rej(err);
1850
- return;
1851
- } else {
1852
- logger.debug('Succeed to get the user session', session);
1853
- res(session);
1854
- return;
1855
- }
1856
- },
1857
- { clientMetadata }
1824
+ },
1825
+ { clientMetadata }
1826
+ );
1827
+ }
1858
1828
  );
1859
- });
1829
+ }
1830
+
1831
+ try {
1832
+ return await this.inflightSessionPromise;
1833
+ } finally {
1834
+ this.inflightSessionPromise = null;
1835
+ }
1836
+ }
1837
+
1838
+ /**
1839
+ * Get the corresponding user session
1840
+ * @param {Object} user - The CognitoUser object
1841
+ * @return - A promise resolves to the session
1842
+ */
1843
+ public userSession(user): Promise<CognitoUserSession> {
1844
+ return this._userSession(user);
1860
1845
  }
1861
1846
 
1862
1847
  /**
package/src/Errors.ts CHANGED
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2019-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  import { AuthErrorMessages, AuthErrorTypes } from './types';
15
5
  import { ConsoleLogger as Logger } from '@aws-amplify/core';
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  import { parse } from 'url'; // Used for OAuth parsing of Cognito Hosted UI
15
5
  import { launchUri } from './urlOpener';
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  const obj: {
15
5
  oauth_state?: string;
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  export const setState = (state: string) => {
15
5
  window.sessionStorage.setItem('oauth_state', state);
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  import { Linking } from 'react-native';
15
5
 
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  const SELF = '_self';
15
5
 
package/src/index.ts CHANGED
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  import { Auth } from './Auth';
15
5
  import {
package/src/types/Auth.ts CHANGED
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  import {
15
5
  ICookieStorageData,
@@ -1,14 +1,4 @@
1
- /*
2
- * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  export * from './Auth';
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
  import { ConsoleLogger as Logger } from '@aws-amplify/core';
14
4
  const logger = new Logger('urlListener');
15
5
 
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
  import { browserOrNode } from '@aws-amplify/core';
14
4
 
15
5
  export default callback => {