@aws-amplify/auth 4.6.2-next.36 → 4.6.2-next.44
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.
- package/CHANGELOG.md +8 -0
- package/lib/Auth.d.ts +2 -0
- package/lib/Auth.js +150 -155
- package/lib/Auth.js.map +1 -1
- package/lib/Errors.js +2 -12
- package/lib/Errors.js.map +1 -1
- package/lib/OAuth/OAuth.js +2 -12
- package/lib/OAuth/OAuth.js.map +1 -1
- package/lib/OAuth/oauthStorage.js +2 -12
- package/lib/OAuth/oauthStorage.js.map +1 -1
- package/lib/OAuth/oauthStorage.native.js +2 -12
- package/lib/OAuth/oauthStorage.native.js.map +1 -1
- package/lib/OAuth/urlOpener.js +2 -12
- package/lib/OAuth/urlOpener.js.map +1 -1
- package/lib/OAuth/urlOpener.native.js +2 -12
- package/lib/OAuth/urlOpener.native.js.map +1 -1
- package/lib/index.js +2 -12
- package/lib/index.js.map +1 -1
- package/lib/types/Auth.js +2 -12
- package/lib/types/Auth.js.map +1 -1
- package/lib/types/index.js +2 -12
- package/lib/types/index.js.map +1 -1
- package/lib/urlListener.js +2 -12
- package/lib/urlListener.js.map +1 -1
- package/lib/urlListener.native.js +2 -12
- package/lib/urlListener.native.js.map +1 -1
- package/lib-esm/Auth.d.ts +2 -0
- package/lib-esm/Auth.js +150 -155
- package/lib-esm/Auth.js.map +1 -1
- package/lib-esm/Errors.js +2 -12
- package/lib-esm/Errors.js.map +1 -1
- package/lib-esm/OAuth/OAuth.js +2 -12
- package/lib-esm/OAuth/OAuth.js.map +1 -1
- package/lib-esm/OAuth/oauthStorage.js +2 -12
- package/lib-esm/OAuth/oauthStorage.js.map +1 -1
- package/lib-esm/OAuth/oauthStorage.native.js +2 -12
- package/lib-esm/OAuth/oauthStorage.native.js.map +1 -1
- package/lib-esm/OAuth/urlOpener.js +2 -12
- package/lib-esm/OAuth/urlOpener.js.map +1 -1
- package/lib-esm/OAuth/urlOpener.native.js +2 -12
- package/lib-esm/OAuth/urlOpener.native.js.map +1 -1
- package/lib-esm/index.js +2 -12
- package/lib-esm/index.js.map +1 -1
- package/lib-esm/types/Auth.js +2 -12
- package/lib-esm/types/Auth.js.map +1 -1
- package/lib-esm/types/index.js +2 -12
- package/lib-esm/types/index.js.map +1 -1
- package/lib-esm/urlListener.js +2 -12
- package/lib-esm/urlListener.js.map +1 -1
- package/lib-esm/urlListener.native.js +2 -12
- package/lib-esm/urlListener.native.js.map +1 -1
- package/package.json +4 -5
- package/src/Auth.ts +109 -124
- package/src/Errors.ts +2 -12
- package/src/OAuth/OAuth.ts +2 -12
- package/src/OAuth/oauthStorage.native.ts +2 -12
- package/src/OAuth/oauthStorage.ts +2 -12
- package/src/OAuth/urlOpener.native.ts +2 -12
- package/src/OAuth/urlOpener.ts +2 -12
- package/src/index.ts +2 -12
- package/src/types/Auth.ts +2 -12
- package/src/types/index.ts +2 -12
- package/src/urlListener.native.ts +2 -12
- package/src/urlListener.ts +2 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlListener.native.js","sourceRoot":"","sources":["../src/urlListener.native.ts"],"names":[],"mappings":";AAAA
|
|
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.
|
|
3
|
+
"version": "4.6.2-next.44+a56ee24f3",
|
|
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/
|
|
51
|
-
"
|
|
52
|
-
"amazon-cognito-identity-js": "5.2.11-next.60+580cda186",
|
|
50
|
+
"@aws-amplify/core": "4.6.2-next.44+a56ee24f3",
|
|
51
|
+
"amazon-cognito-identity-js": "5.2.11-next.68+a56ee24f3",
|
|
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": "
|
|
104
|
+
"gitHead": "a56ee24f321d5bb7b891a8ecd21819ae63041018"
|
|
106
105
|
}
|
package/src/Auth.ts
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
|
|
1636
|
-
|
|
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
|
-
|
|
1656
|
-
|
|
1626
|
+
// get user data from Cognito
|
|
1627
|
+
const bypassCache = params ? params.bypassCache : false;
|
|
1657
1628
|
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1629
|
+
if (bypassCache) {
|
|
1630
|
+
await this.Credentials.clear();
|
|
1631
|
+
}
|
|
1661
1632
|
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
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
|
-
|
|
1687
|
-
}
|
|
1688
|
-
|
|
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
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
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;
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
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
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
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
|
-
|
|
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';
|
package/src/OAuth/OAuth.ts
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
package/src/OAuth/urlOpener.ts
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
package/src/types/index.ts
CHANGED
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
|
|
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
|
|
package/src/urlListener.ts
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 => {
|