@aws-amplify/auth 4.6.14-unstable.4 → 4.6.15-unstable.2
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/lib/.tsbuildinfo +3 -0
- package/lib/Auth.d.ts +301 -0
- package/lib/Auth.js +65 -140
- package/lib/Auth.js.map +1 -1
- package/lib/Errors.d.ts +9 -0
- package/lib/Errors.js +5 -27
- package/lib/Errors.js.map +1 -1
- package/lib/OAuth/OAuth.d.ts +29 -0
- package/lib/OAuth/OAuth.js +36 -118
- package/lib/OAuth/OAuth.js.map +1 -1
- package/lib/OAuth/oauthStorage.d.ts +5 -0
- package/lib/OAuth/oauthStorage.js +2 -12
- package/lib/OAuth/oauthStorage.js.map +1 -1
- package/lib/OAuth/oauthStorage.native.d.ts +5 -0
- package/lib/OAuth/oauthStorage.native.js +2 -12
- package/lib/OAuth/oauthStorage.native.js.map +1 -1
- package/lib/OAuth/urlOpener.d.ts +1 -0
- package/lib/OAuth/urlOpener.js +2 -12
- package/lib/OAuth/urlOpener.js.map +1 -1
- package/lib/OAuth/urlOpener.native.d.ts +1 -0
- package/lib/OAuth/urlOpener.native.js +2 -12
- package/lib/OAuth/urlOpener.native.js.map +1 -1
- package/lib/common/AuthErrorStrings.d.ts +17 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.js +2 -12
- package/lib/index.js.map +1 -1
- package/lib/types/Auth.d.ts +170 -0
- package/lib/types/Auth.js +2 -12
- package/lib/types/Auth.js.map +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +4 -16
- package/lib/types/index.js.map +1 -1
- package/lib/urlListener.d.ts +2 -0
- package/lib/urlListener.js +2 -12
- package/lib/urlListener.js.map +1 -1
- package/lib/urlListener.native.d.ts +2 -0
- package/lib/urlListener.native.js +9 -76
- package/lib/urlListener.native.js.map +1 -1
- package/lib-esm/.tsbuildinfo +3 -0
- package/lib-esm/Auth.js +5 -77
- package/lib-esm/Auth.js.map +1 -1
- package/lib-esm/Errors.js +3 -25
- package/lib-esm/Errors.js.map +1 -1
- package/lib-esm/OAuth/OAuth.js +13 -85
- 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 +3 -70
- package/lib-esm/urlListener.native.js.map +1 -1
- package/package.json +13 -11
- package/src/Auth.ts +4 -14
- package/src/Errors.ts +2 -12
- package/src/OAuth/OAuth.ts +27 -37
- 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
- package/build.js +0 -5
- package/dist/aws-amplify-auth.js +0 -14708
- package/dist/aws-amplify-auth.js.map +0 -1
- package/dist/aws-amplify-auth.min.js +0 -44
- package/dist/aws-amplify-auth.min.js.map +0 -1
- package/index.js +0 -7
- package/testSequencer.js +0 -24
- package/webpack.config.dev.js +0 -6
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { ICookieStorageData, ICognitoStorage } from 'amazon-cognito-identity-js';
|
|
2
|
+
/**
|
|
3
|
+
* Parameters for user sign up
|
|
4
|
+
*/
|
|
5
|
+
export interface SignUpParams {
|
|
6
|
+
username: string;
|
|
7
|
+
password: string;
|
|
8
|
+
attributes?: object;
|
|
9
|
+
validationData?: {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
};
|
|
12
|
+
clientMetadata?: {
|
|
13
|
+
[key: string]: string;
|
|
14
|
+
};
|
|
15
|
+
autoSignIn?: AutoSignInOptions;
|
|
16
|
+
}
|
|
17
|
+
export interface AuthCache {
|
|
18
|
+
setItem(): any;
|
|
19
|
+
getItem(): any;
|
|
20
|
+
removeItem(): any;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Auth instance options
|
|
24
|
+
*/
|
|
25
|
+
export interface AuthOptions {
|
|
26
|
+
userPoolId?: string;
|
|
27
|
+
userPoolWebClientId?: string;
|
|
28
|
+
identityPoolId?: string;
|
|
29
|
+
region?: string;
|
|
30
|
+
mandatorySignIn?: boolean;
|
|
31
|
+
cookieStorage?: ICookieStorageData;
|
|
32
|
+
oauth?: OAuthOpts;
|
|
33
|
+
refreshHandlers?: object;
|
|
34
|
+
storage?: ICognitoStorage;
|
|
35
|
+
authenticationFlowType?: string;
|
|
36
|
+
identityPoolRegion?: string;
|
|
37
|
+
clientMetadata?: any;
|
|
38
|
+
endpoint?: string;
|
|
39
|
+
signUpVerificationMethod?: 'code' | 'link';
|
|
40
|
+
}
|
|
41
|
+
export declare enum CognitoHostedUIIdentityProvider {
|
|
42
|
+
Cognito = "COGNITO",
|
|
43
|
+
Google = "Google",
|
|
44
|
+
Facebook = "Facebook",
|
|
45
|
+
Amazon = "LoginWithAmazon",
|
|
46
|
+
Apple = "SignInWithApple"
|
|
47
|
+
}
|
|
48
|
+
export declare type LegacyProvider = 'google' | 'facebook' | 'amazon' | 'developer' | string;
|
|
49
|
+
export declare type FederatedSignInOptions = {
|
|
50
|
+
provider: CognitoHostedUIIdentityProvider;
|
|
51
|
+
customState?: string;
|
|
52
|
+
};
|
|
53
|
+
export declare type FederatedSignInOptionsCustom = {
|
|
54
|
+
customProvider: string;
|
|
55
|
+
customState?: string;
|
|
56
|
+
};
|
|
57
|
+
export declare function isFederatedSignInOptions(obj: any): obj is FederatedSignInOptions;
|
|
58
|
+
export declare function isFederatedSignInOptionsCustom(obj: any): obj is FederatedSignInOptionsCustom;
|
|
59
|
+
export declare function hasCustomState(obj: any): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Details for multi-factor authentication
|
|
62
|
+
*/
|
|
63
|
+
export interface MfaRequiredDetails {
|
|
64
|
+
challengeName: any;
|
|
65
|
+
challengeParameters: any;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* interface for federatedResponse
|
|
69
|
+
*/
|
|
70
|
+
export interface FederatedResponse {
|
|
71
|
+
token: string;
|
|
72
|
+
identity_id?: string;
|
|
73
|
+
expires_at: number;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* interface for federatedUser
|
|
77
|
+
*/
|
|
78
|
+
export interface FederatedUser {
|
|
79
|
+
name: string;
|
|
80
|
+
email?: string;
|
|
81
|
+
picture?: string;
|
|
82
|
+
}
|
|
83
|
+
export interface AwsCognitoOAuthOpts {
|
|
84
|
+
domain: string;
|
|
85
|
+
scope: Array<string>;
|
|
86
|
+
redirectSignIn: string;
|
|
87
|
+
redirectSignOut: string;
|
|
88
|
+
responseType: string;
|
|
89
|
+
options?: object;
|
|
90
|
+
urlOpener?: (url: string, redirectUrl: string) => Promise<any>;
|
|
91
|
+
}
|
|
92
|
+
export declare function isCognitoHostedOpts(oauth: OAuthOpts): oauth is AwsCognitoOAuthOpts;
|
|
93
|
+
export interface Auth0OAuthOpts {
|
|
94
|
+
domain: string;
|
|
95
|
+
clientID: string;
|
|
96
|
+
scope: string;
|
|
97
|
+
redirectUri: string;
|
|
98
|
+
audience: string;
|
|
99
|
+
responseType: string;
|
|
100
|
+
returnTo: string;
|
|
101
|
+
urlOpener?: (url: string, redirectUrl: string) => Promise<any>;
|
|
102
|
+
}
|
|
103
|
+
export declare type OAuthOpts = AwsCognitoOAuthOpts | Auth0OAuthOpts;
|
|
104
|
+
export interface ConfirmSignUpOptions {
|
|
105
|
+
forceAliasCreation?: boolean;
|
|
106
|
+
clientMetadata?: ClientMetaData;
|
|
107
|
+
}
|
|
108
|
+
export interface SignOutOpts {
|
|
109
|
+
global?: boolean;
|
|
110
|
+
}
|
|
111
|
+
export interface CurrentUserOpts {
|
|
112
|
+
bypassCache: boolean;
|
|
113
|
+
}
|
|
114
|
+
export interface GetPreferredMFAOpts {
|
|
115
|
+
bypassCache: boolean;
|
|
116
|
+
}
|
|
117
|
+
export declare type UsernamePasswordOpts = {
|
|
118
|
+
username: string;
|
|
119
|
+
password: string;
|
|
120
|
+
validationData?: {
|
|
121
|
+
[key: string]: any;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
export declare enum AuthErrorTypes {
|
|
125
|
+
NoConfig = "noConfig",
|
|
126
|
+
MissingAuthConfig = "missingAuthConfig",
|
|
127
|
+
EmptyUsername = "emptyUsername",
|
|
128
|
+
InvalidUsername = "invalidUsername",
|
|
129
|
+
EmptyPassword = "emptyPassword",
|
|
130
|
+
EmptyCode = "emptyCode",
|
|
131
|
+
SignUpError = "signUpError",
|
|
132
|
+
NoMFA = "noMFA",
|
|
133
|
+
InvalidMFA = "invalidMFA",
|
|
134
|
+
EmptyChallengeResponse = "emptyChallengeResponse",
|
|
135
|
+
NoUserSession = "noUserSession",
|
|
136
|
+
Default = "default",
|
|
137
|
+
DeviceConfig = "deviceConfig",
|
|
138
|
+
NetworkError = "networkError",
|
|
139
|
+
AutoSignInError = "autoSignInError"
|
|
140
|
+
}
|
|
141
|
+
export declare type AuthErrorMessages = {
|
|
142
|
+
[key in AuthErrorTypes]: AuthErrorMessage;
|
|
143
|
+
};
|
|
144
|
+
export interface AuthErrorMessage {
|
|
145
|
+
message: string;
|
|
146
|
+
log?: string;
|
|
147
|
+
}
|
|
148
|
+
export declare type SignInOpts = UsernamePasswordOpts;
|
|
149
|
+
export declare type ClientMetaData = {
|
|
150
|
+
[key: string]: string;
|
|
151
|
+
} | undefined;
|
|
152
|
+
export declare function isUsernamePasswordOpts(obj: any): obj is UsernamePasswordOpts;
|
|
153
|
+
export interface IAuthDevice {
|
|
154
|
+
id: string;
|
|
155
|
+
name: string;
|
|
156
|
+
}
|
|
157
|
+
export interface AutoSignInOptions {
|
|
158
|
+
enabled: boolean;
|
|
159
|
+
clientMetaData?: ClientMetaData;
|
|
160
|
+
validationData?: {
|
|
161
|
+
[key: string]: any;
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
export declare enum GRAPHQL_AUTH_MODE {
|
|
165
|
+
API_KEY = "API_KEY",
|
|
166
|
+
AWS_IAM = "AWS_IAM",
|
|
167
|
+
OPENID_CONNECT = "OPENID_CONNECT",
|
|
168
|
+
AMAZON_COGNITO_USER_POOLS = "AMAZON_COGNITO_USER_POOLS",
|
|
169
|
+
AWS_LAMBDA = "AWS_LAMBDA"
|
|
170
|
+
}
|
package/lib/types/Auth.js
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
6
|
-
* the License. A copy of the License is located at
|
|
7
|
-
*
|
|
8
|
-
* http://aws.amazon.com/apache2.0/
|
|
9
|
-
*
|
|
10
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
11
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
12
|
-
* and limitations under the License.
|
|
13
|
-
*/
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
14
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
5
|
var CognitoHostedUIIdentityProvider;
|
|
16
6
|
(function (CognitoHostedUIIdentityProvider) {
|
package/lib/types/Auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Auth.js","sourceRoot":"","sources":["../../src/types/Auth.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"Auth.js","sourceRoot":"","sources":["../../src/types/Auth.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;AA6CtC,IAAY,+BAMX;AAND,WAAY,+BAA+B;IAC1C,sDAAmB,CAAA;IACnB,oDAAiB,CAAA;IACjB,wDAAqB,CAAA;IACrB,6DAA0B,CAAA;IAC1B,4DAAyB,CAAA;AAC1B,CAAC,EANW,+BAA+B,GAA/B,uCAA+B,KAA/B,uCAA+B,QAM1C;AAmBD,SAAgB,wBAAwB,CACvC,GAAQ;IAER,IAAM,IAAI,GAAqC,CAAC,UAAU,CAAC,CAAC;IAC5D,OAAO,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,EAArB,CAAqB,CAAC,CAAC;AACvD,CAAC;AALD,4DAKC;AAED,SAAgB,8BAA8B,CAC7C,GAAQ;IAER,IAAM,IAAI,GAA2C,CAAC,gBAAgB,CAAC,CAAC;IACxE,OAAO,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,EAArB,CAAqB,CAAC,CAAC;AACvD,CAAC;AALD,wEAKC;AAED,SAAgB,cAAc,CAAC,GAAQ;IACtC,IAAM,IAAI,GAGH,CAAC,aAAa,CAAC,CAAC;IACvB,OAAO,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,EAArB,CAAqB,CAAC,CAAC;AACvD,CAAC;AAND,wCAMC;AAyCD,SAAgB,mBAAmB,CAClC,KAAgB;IAEhB,OAA6B,KAAM,CAAC,cAAc,KAAK,SAAS,CAAC;AAClE,CAAC;AAJD,kDAIC;AA4CD,IAAY,cAgBX;AAhBD,WAAY,cAAc;IACzB,uCAAqB,CAAA;IACrB,yDAAuC,CAAA;IACvC,iDAA+B,CAAA;IAC/B,qDAAmC,CAAA;IACnC,iDAA+B,CAAA;IAC/B,yCAAuB,CAAA;IACvB,6CAA2B,CAAA;IAC3B,iCAAe,CAAA;IACf,2CAAyB,CAAA;IACzB,mEAAiD,CAAA;IACjD,iDAA+B,CAAA;IAC/B,qCAAmB,CAAA;IACnB,+CAA6B,CAAA;IAC7B,+CAA6B,CAAA;IAC7B,qDAAmC,CAAA;AACpC,CAAC,EAhBW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAgBzB;AAkBD,SAAgB,sBAAsB,CAAC,GAAQ;IAC9C,OAAO,CAAC,CAAE,GAA4B,CAAC,QAAQ,CAAC;AACjD,CAAC;AAFD,wDAEC;AAaD,IAAY,iBAMX;AAND,WAAY,iBAAiB;IAC5B,wCAAmB,CAAA;IACnB,wCAAmB,CAAA;IACnB,sDAAiC,CAAA;IACjC,4EAAuD,CAAA;IACvD,8CAAyB,CAAA;AAC1B,CAAC,EANW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAM5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Auth';
|
package/lib/types/index.js
CHANGED
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
6
|
-
* the License. A copy of the License is located at
|
|
7
|
-
*
|
|
8
|
-
* http://aws.amazon.com/apache2.0/
|
|
9
|
-
*
|
|
10
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
11
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
12
|
-
* and limitations under the License.
|
|
13
|
-
*/
|
|
14
|
-
function __export(m) {
|
|
15
|
-
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
16
|
-
}
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
17
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
|
|
5
|
+
var tslib_1 = require("tslib");
|
|
6
|
+
tslib_1.__exportStar(require("./Auth"), exports);
|
|
19
7
|
//# sourceMappingURL=index.js.map
|
package/lib/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,iDAAuB"}
|
package/lib/urlListener.js
CHANGED
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
7
|
-
* the License. A copy of the License is located at
|
|
8
|
-
*
|
|
9
|
-
* http://aws.amazon.com/apache2.0/
|
|
10
|
-
*
|
|
11
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
12
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
13
|
-
* and limitations under the License.
|
|
14
|
-
*/
|
|
3
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
15
5
|
var core_1 = require("@aws-amplify/core");
|
|
16
6
|
exports.default = (function (callback) {
|
|
17
7
|
if (core_1.browserOrNode().isBrowser && window.location) {
|
package/lib/urlListener.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlListener.js","sourceRoot":"","sources":["../src/urlListener.ts"],"names":[],"mappings":";;AAAA
|
|
1
|
+
{"version":3,"file":"urlListener.js","sourceRoot":"","sources":["../src/urlListener.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,0CAAkD;AAElD,mBAAe,UAAA,QAAQ;IACtB,IAAI,oBAAa,EAAE,CAAC,SAAS,IAAI,MAAM,CAAC,QAAQ,EAAE;QACjD,IAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QAEjC,QAAQ,CAAC,EAAE,GAAG,KAAA,EAAE,CAAC,CAAC;KAClB;SAAM,IAAI,oBAAa,EAAE,CAAC,MAAM,EAAE;QAClC,2BAA2B;QAC3B,CAAA,cAAO,CAAC,CAAA,CAAC,CAAC,OAAO;KACjB;SAAM;QACN,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;KACjC;AACF,CAAC,EAAC"}
|
|
@@ -1,83 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (_) try {
|
|
29
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
50
|
-
var t = {};
|
|
51
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
52
|
-
t[p] = s[p];
|
|
53
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
54
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
55
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
56
|
-
t[p[i]] = s[p[i]];
|
|
57
|
-
}
|
|
58
|
-
return t;
|
|
59
|
-
};
|
|
60
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
65
|
-
* the License. A copy of the License is located at
|
|
66
|
-
*
|
|
67
|
-
* http://aws.amazon.com/apache2.0/
|
|
68
|
-
*
|
|
69
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
70
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
71
|
-
* and limitations under the License.
|
|
72
|
-
*/
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
5
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
73
6
|
var core_1 = require("@aws-amplify/core");
|
|
74
7
|
var logger = new core_1.ConsoleLogger('urlListener');
|
|
75
8
|
var handler;
|
|
76
|
-
exports.default = (function (callback) { return __awaiter(void 0, void 0, void 0, function () {
|
|
9
|
+
exports.default = (function (callback) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
77
10
|
var Linking, AppState, subscription;
|
|
78
11
|
var _a;
|
|
79
12
|
var _b;
|
|
80
|
-
return __generator(this, function (_c) {
|
|
13
|
+
return tslib_1.__generator(this, function (_c) {
|
|
81
14
|
if (handler) {
|
|
82
15
|
return [2 /*return*/];
|
|
83
16
|
}
|
|
@@ -90,8 +23,8 @@ exports.default = (function (callback) { return __awaiter(void 0, void 0, void 0
|
|
|
90
23
|
handler =
|
|
91
24
|
handler ||
|
|
92
25
|
(function (_a) {
|
|
93
|
-
var url = _a.url, rest = __rest(_a, ["url"]);
|
|
94
|
-
logger.debug('urlListener', __assign({ url: url }, rest));
|
|
26
|
+
var url = _a.url, rest = tslib_1.__rest(_a, ["url"]);
|
|
27
|
+
logger.debug('urlListener', tslib_1.__assign({ url: url }, rest));
|
|
95
28
|
callback({ url: url });
|
|
96
29
|
});
|
|
97
30
|
// Handles backward compatibility. removeEventListener is only available on RN versions before 0.65.
|
|
@@ -104,9 +37,9 @@ exports.default = (function (callback) { return __awaiter(void 0, void 0, void 0
|
|
|
104
37
|
(_b = subscription === null || subscription === void 0 ? void 0 : subscription.remove) === null || _b === void 0 ? void 0 : _b.call(subscription);
|
|
105
38
|
subscription = Linking.addEventListener('url', handler);
|
|
106
39
|
}
|
|
107
|
-
AppState.addEventListener('change', function (newAppState) { return __awaiter(void 0, void 0, void 0, function () {
|
|
40
|
+
AppState.addEventListener('change', function (newAppState) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
108
41
|
var initialUrl;
|
|
109
|
-
return __generator(this, function (_a) {
|
|
42
|
+
return tslib_1.__generator(this, function (_a) {
|
|
110
43
|
switch (_a.label) {
|
|
111
44
|
case 0:
|
|
112
45
|
if (!(newAppState === 'active')) return [3 /*break*/, 2];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlListener.native.js","sourceRoot":"","sources":["../src/urlListener.native.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"urlListener.native.js","sourceRoot":"","sources":["../src/urlListener.native.ts"],"names":[],"mappings":";;;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,0CAA4D;AAC5D,IAAM,MAAM,GAAG,IAAI,oBAAM,CAAC,aAAa,CAAC,CAAC;AAEzC,IAAI,OAAO,CAAC;AAEZ,mBAAe,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,kCAAO;oBACf,MAAM,CAAC,KAAK,CAAC,aAAa,qBAAI,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/lib-esm/Auth.js
CHANGED
|
@@ -1,80 +1,8 @@
|
|
|
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
|
-
*/
|
|
13
|
-
var __assign = (this && this.__assign) || function () {
|
|
14
|
-
__assign = Object.assign || function(t) {
|
|
15
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
16
|
-
s = arguments[i];
|
|
17
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
18
|
-
t[p] = s[p];
|
|
19
|
-
}
|
|
20
|
-
return t;
|
|
21
|
-
};
|
|
22
|
-
return __assign.apply(this, arguments);
|
|
23
|
-
};
|
|
24
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
25
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
26
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
27
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
28
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
29
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
30
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
34
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
35
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
36
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
37
|
-
function step(op) {
|
|
38
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
39
|
-
while (_) try {
|
|
40
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
41
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
42
|
-
switch (op[0]) {
|
|
43
|
-
case 0: case 1: t = op; break;
|
|
44
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
45
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
46
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
47
|
-
default:
|
|
48
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
49
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
50
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
51
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
52
|
-
if (t[2]) _.ops.pop();
|
|
53
|
-
_.trys.pop(); continue;
|
|
54
|
-
}
|
|
55
|
-
op = body.call(thisArg, _);
|
|
56
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
57
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
61
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
62
|
-
if (!m) return o;
|
|
63
|
-
var i = m.call(o), r, ar = [], e;
|
|
64
|
-
try {
|
|
65
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
66
|
-
}
|
|
67
|
-
catch (error) { e = { error: error }; }
|
|
68
|
-
finally {
|
|
69
|
-
try {
|
|
70
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
71
|
-
}
|
|
72
|
-
finally { if (e) throw e.error; }
|
|
73
|
-
}
|
|
74
|
-
return ar;
|
|
75
|
-
};
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { __assign, __awaiter, __generator, __read } from "tslib";
|
|
76
4
|
import { isUsernamePasswordOpts, isCognitoHostedOpts, isFederatedSignInOptions, isFederatedSignInOptionsCustom, hasCustomState, } from './types';
|
|
77
|
-
import { Amplify, ConsoleLogger as Logger, Credentials, Hub, StorageHelper,
|
|
5
|
+
import { Amplify, ConsoleLogger as Logger, Credentials, Hub, StorageHelper, browserOrNode, parseAWSExports, UniversalStorage, urlSafeDecode, } from '@aws-amplify/core';
|
|
78
6
|
import { CookieStorage, CognitoUserPool, AuthenticationDetails, CognitoUser, CognitoUserSession, CognitoUserAttribute, CognitoIdToken, CognitoRefreshToken, CognitoAccessToken, } from 'amazon-cognito-identity-js';
|
|
79
7
|
import { parse } from 'url';
|
|
80
8
|
import OAuth from './OAuth/OAuth';
|
|
@@ -150,7 +78,7 @@ var AuthClass = /** @class */ (function () {
|
|
|
150
78
|
if (!config)
|
|
151
79
|
return this._config || {};
|
|
152
80
|
logger.debug('configure Auth');
|
|
153
|
-
var conf = Object.assign({}, this._config,
|
|
81
|
+
var conf = Object.assign({}, this._config, parseAWSExports(config).Auth, config);
|
|
154
82
|
this._config = conf;
|
|
155
83
|
var _a = this._config, userPoolId = _a.userPoolId, userPoolWebClientId = _a.userPoolWebClientId, cookieStorage = _a.cookieStorage, oauth = _a.oauth, region = _a.region, identityPoolId = _a.identityPoolId, mandatorySignIn = _a.mandatorySignIn, refreshHandlers = _a.refreshHandlers, identityPoolRegion = _a.identityPoolRegion, clientMetadata = _a.clientMetadata, endpoint = _a.endpoint;
|
|
156
84
|
if (!this._config.storage) {
|