@aws-amplify/auth 5.6.1-v5-auth-internals.9bf4dba.6 → 5.6.1
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/Auth.js +1 -1
- package/lib/Auth.js.map +1 -1
- package/lib/internals/InternalAuth.d.ts +43 -6
- package/lib/internals/InternalAuth.js +43 -19
- package/lib/internals/InternalAuth.js.map +1 -1
- package/lib-esm/Auth.js +2 -2
- package/lib-esm/Auth.js.map +1 -1
- package/lib-esm/internals/InternalAuth.d.ts +43 -6
- package/lib-esm/internals/InternalAuth.js +43 -19
- package/lib-esm/internals/InternalAuth.js.map +1 -1
- package/package.json +6 -5
- package/src/Auth.ts +1 -1
- package/src/internals/InternalAuth.ts +46 -17
package/lib/Auth.js
CHANGED
|
@@ -27,7 +27,7 @@ var AuthClass = /** @class */ (function (_super) {
|
|
|
27
27
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
28
28
|
restOfAttrs[_i - 1] = arguments[_i];
|
|
29
29
|
}
|
|
30
|
-
return _super.prototype.signUp.
|
|
30
|
+
return _super.prototype.signUp.call(this, params, restOfAttrs);
|
|
31
31
|
};
|
|
32
32
|
/**
|
|
33
33
|
* Send the verification code to confirm sign up
|
package/lib/Auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Auth.js","sourceRoot":"","sources":["../src/Auth.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAiBtC,0CAA0D;AAW1D,yDAA6D;AAE7D;;GAEG;AACH;IAA+B,qCAAiB;IAAhD;;IAkbA,CAAC;IAjbO,iCAAa,GAApB;QACC,OAAO,MAAM,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACI,0BAAM,GAAb,UACC,MAA6B;QAC7B,qBAAwB;aAAxB,UAAwB,EAAxB,qBAAwB,EAAxB,IAAwB;YAAxB,oCAAwB;;QAExB,OAAO,iBAAM,MAAM
|
|
1
|
+
{"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W;QACtC,OAAO,iBAAM,oBAAoB,YAAC,WAAW,CAAC,CAAC;IAChD,CAAC;IAEM,kCAAc,GAArB;QACC,OAAO,iBAAM,cAAc,WAAE,CAAC;IAC/B,CAAC;IAEM,gCAAY,GAAnB;QACC,OAAO,iBAAM,YAAY,WAAE,CAAC;IAC7B,CAAC;IAEM,gCAAY,GAAnB;QACC,OAAO,iBAAM,YAAY,WAAE,CAAC;IAC7B,CAAC;IACF,gBAAC;AAAD,CAAC,AAlbD,CAA+B,gCAAiB,GAkb/C;AAlbY,8BAAS;AAobT,QAAA,IAAI,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC;AACxC,cAAO,CAAC,QAAQ,CAAC,YAAI,CAAC,CAAC"}
|
|
@@ -31,10 +31,10 @@ export declare class InternalAuthClass {
|
|
|
31
31
|
* Sign up with username, password and other attributes like phone, email
|
|
32
32
|
* @param {String | object} params - The user attributes used for signin
|
|
33
33
|
* @param {String[]} restOfAttrs - for the backward compatability
|
|
34
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
34
35
|
* @return - A promise resolves callback data if success
|
|
35
36
|
*/
|
|
36
|
-
signUp(params: string | SignUpParams, ...restOfAttrs:
|
|
37
|
-
internalSignUp(params: string | SignUpParams, restOfAttrs?: string[], customUserAgentDetails?: CustomUserAgentDetails): Promise<ISignUpResult>;
|
|
37
|
+
signUp(params: string | SignUpParams, ...restOfAttrs: any): Promise<ISignUpResult>;
|
|
38
38
|
private handleAutoSignIn;
|
|
39
39
|
private handleCodeAutoSignIn;
|
|
40
40
|
private handleLinkAutoSignIn;
|
|
@@ -44,6 +44,7 @@ export declare class InternalAuthClass {
|
|
|
44
44
|
* @param {String} username - The username to be confirmed
|
|
45
45
|
* @param {String} code - The verification code
|
|
46
46
|
* @param {ConfirmSignUpOptions} options - other options for confirm signup
|
|
47
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
47
48
|
* @return - A promise resolves callback data if success
|
|
48
49
|
*/
|
|
49
50
|
confirmSignUp(username: string, code: string, options?: ConfirmSignUpOptions, customUserAgentDetails?: CustomUserAgentDetails): Promise<any>;
|
|
@@ -52,6 +53,7 @@ export declare class InternalAuthClass {
|
|
|
52
53
|
* Resend the verification code
|
|
53
54
|
* @param {String} username - The username to be confirmed
|
|
54
55
|
* @param {ClientMetadata} clientMetadata - Metadata to be passed to Cognito Lambda triggers
|
|
56
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
55
57
|
* @return - A promise resolves code delivery details if successful
|
|
56
58
|
*/
|
|
57
59
|
resendSignUp(username: string, clientMetadata?: ClientMetaData, customUserAgentDetails?: CustomUserAgentDetails): Promise<any>;
|
|
@@ -91,6 +93,7 @@ export declare class InternalAuthClass {
|
|
|
91
93
|
* how to setup and use MFA: https://docs.amplify.aws/lib/auth/mfa/q/platform/js
|
|
92
94
|
* @deprecated
|
|
93
95
|
* @param {CognitoUser} user - the current user
|
|
96
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
94
97
|
* @return - A promise resolves the current preferred mfa option if success
|
|
95
98
|
*/
|
|
96
99
|
getMFAOptions(user: CognitoUser | any, customUserAgentDetails?: CustomUserAgentDetails): Promise<MFAOption[]>;
|
|
@@ -98,6 +101,7 @@ export declare class InternalAuthClass {
|
|
|
98
101
|
* get preferred mfa method
|
|
99
102
|
* @param {CognitoUser} user - the current cognito user
|
|
100
103
|
* @param {GetPreferredMFAOpts} params - options for getting the current user preferred MFA
|
|
104
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
101
105
|
*/
|
|
102
106
|
getPreferredMFA(user: CognitoUser | any, params?: GetPreferredMFAOpts, customUserAgentDetails?: CustomUserAgentDetails): Promise<string>;
|
|
103
107
|
private _getMfaTypeFromUserData;
|
|
@@ -106,6 +110,7 @@ export declare class InternalAuthClass {
|
|
|
106
110
|
* set preferred MFA method
|
|
107
111
|
* @param {CognitoUser} user - the current Cognito user
|
|
108
112
|
* @param {string} mfaMethod - preferred mfa method
|
|
113
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
109
114
|
* @return - A promise resolve if success
|
|
110
115
|
*/
|
|
111
116
|
setPreferredMFA(user: CognitoUser | any, mfaMethod: 'TOTP' | 'SMS' | 'NOMFA' | 'SMS_MFA' | 'SOFTWARE_TOKEN_MFA', customUserAgentDetails?: CustomUserAgentDetails): Promise<string>;
|
|
@@ -113,6 +118,7 @@ export declare class InternalAuthClass {
|
|
|
113
118
|
* disable SMS
|
|
114
119
|
* @deprecated
|
|
115
120
|
* @param {CognitoUser} user - the current user
|
|
121
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
116
122
|
* @return - A promise resolves is success
|
|
117
123
|
*/
|
|
118
124
|
disableSMS(user: CognitoUser, customUserAgentDetails?: CustomUserAgentDetails): Promise<string>;
|
|
@@ -120,12 +126,14 @@ export declare class InternalAuthClass {
|
|
|
120
126
|
* enable SMS
|
|
121
127
|
* @deprecated
|
|
122
128
|
* @param {CognitoUser} user - the current user
|
|
129
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
123
130
|
* @return - A promise resolves is success
|
|
124
131
|
*/
|
|
125
132
|
enableSMS(user: CognitoUser, customUserAgentDetails?: CustomUserAgentDetails): Promise<string>;
|
|
126
133
|
/**
|
|
127
134
|
* Setup TOTP
|
|
128
135
|
* @param {CognitoUser} user - the current user
|
|
136
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
129
137
|
* @return - A promise resolves with the secret code if success
|
|
130
138
|
*/
|
|
131
139
|
setupTOTP(user: CognitoUser | any, customUserAgentDetails?: CustomUserAgentDetails): Promise<string>;
|
|
@@ -133,6 +141,7 @@ export declare class InternalAuthClass {
|
|
|
133
141
|
* verify TOTP setup
|
|
134
142
|
* @param {CognitoUser} user - the current user
|
|
135
143
|
* @param {string} challengeAnswer - challenge answer
|
|
144
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
136
145
|
* @return - A promise resolves is success
|
|
137
146
|
*/
|
|
138
147
|
verifyTotpToken(user: CognitoUser | any, challengeAnswer: string, customUserAgentDetails?: CustomUserAgentDetails): Promise<CognitoUserSession>;
|
|
@@ -140,6 +149,9 @@ export declare class InternalAuthClass {
|
|
|
140
149
|
* Send MFA code to confirm sign in
|
|
141
150
|
* @param {Object} user - The CognitoUser object
|
|
142
151
|
* @param {String} code - The confirmation code
|
|
152
|
+
* @param {string} mfaType - optional mfaType: 'SMS_MFA' | 'SOFTWARE_TOKEN_MFA'
|
|
153
|
+
* @param {ClientMetaData} clientMetadata - optional client metadata defaults to config
|
|
154
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
143
155
|
*/
|
|
144
156
|
confirmSignIn(user: CognitoUser | any, code: string, mfaType?: 'SMS_MFA' | 'SOFTWARE_TOKEN_MFA' | null, clientMetadata?: ClientMetaData, customUserAgentDetails?: CustomUserAgentDetails): Promise<CognitoUser | any>;
|
|
145
157
|
completeNewPassword(user: CognitoUser | any, password: string, requiredAttributes?: any, clientMetadata?: ClientMetaData, customUserAgentDetails?: CustomUserAgentDetails): Promise<CognitoUser | any>;
|
|
@@ -147,22 +159,30 @@ export declare class InternalAuthClass {
|
|
|
147
159
|
* Send the answer to a custom challenge
|
|
148
160
|
* @param {CognitoUser} user - The CognitoUser object
|
|
149
161
|
* @param {String} challengeResponses - The confirmation code
|
|
162
|
+
* @param {ClientMetaData} clientMetadata - optional client metadata defaults to config
|
|
163
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
150
164
|
*/
|
|
151
165
|
sendCustomChallengeAnswer(user: CognitoUser | any, challengeResponses: string, clientMetadata?: ClientMetaData, customUserAgentDetails?: CustomUserAgentDetails): Promise<CognitoUser | any>;
|
|
152
166
|
/**
|
|
153
167
|
* Delete an authenticated users' attributes
|
|
154
|
-
* @param {CognitoUser} - The currently logged in user object
|
|
168
|
+
* @param {CognitoUser} user - The currently logged in user object
|
|
169
|
+
* @param {string[]} attributeNames - Attributes to delete
|
|
170
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
155
171
|
* @return {Promise}
|
|
156
172
|
**/
|
|
157
173
|
deleteUserAttributes(user: CognitoUser | any, attributeNames: string[], customUserAgentDetails?: CustomUserAgentDetails): Promise<unknown>;
|
|
158
174
|
/**
|
|
159
175
|
* Delete the current authenticated user
|
|
176
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
160
177
|
* @return {Promise}
|
|
161
178
|
**/
|
|
162
179
|
deleteUser(customUserAgentDetails?: CustomUserAgentDetails): Promise<string | void>;
|
|
163
180
|
/**
|
|
164
181
|
* Update an authenticated users' attributes
|
|
165
|
-
* @param {CognitoUser} - The currently logged in user object
|
|
182
|
+
* @param {CognitoUser} user - The currently logged in user object
|
|
183
|
+
* @param {object} attributes - attributes to update
|
|
184
|
+
* @param {ClientMetaData} clientMetadata - optional client metadata, defaults to config
|
|
185
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
166
186
|
* @return {Promise}
|
|
167
187
|
**/
|
|
168
188
|
updateUserAttributes(user: CognitoUser | any, attributes: object, clientMetadata?: ClientMetaData, customUserAgentDetails?: CustomUserAgentDetails): Promise<string>;
|
|
@@ -170,6 +190,7 @@ export declare class InternalAuthClass {
|
|
|
170
190
|
/**
|
|
171
191
|
* Return user attributes
|
|
172
192
|
* @param {Object} user - The CognitoUser object
|
|
193
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
173
194
|
* @return - A promise resolves to user attributes if success
|
|
174
195
|
*/
|
|
175
196
|
userAttributes(user: CognitoUser | any, customUserAgentDetails?: CustomUserAgentDetails): Promise<CognitoUserAttribute[]>;
|
|
@@ -189,6 +210,8 @@ export declare class InternalAuthClass {
|
|
|
189
210
|
private cleanUpInvalidSession;
|
|
190
211
|
/**
|
|
191
212
|
* Get current authenticated user
|
|
213
|
+
* @param {CurrentUserOpts} params - options for getting the current user
|
|
214
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
192
215
|
* @return - A promise resolves to current authenticated CognitoUser if success
|
|
193
216
|
*/
|
|
194
217
|
currentUserPoolUser(params?: CurrentUserOpts, customUserAgentDetails?: CustomUserAgentDetails): Promise<CognitoUser | any>;
|
|
@@ -196,11 +219,13 @@ export declare class InternalAuthClass {
|
|
|
196
219
|
/**
|
|
197
220
|
* Get current authenticated user
|
|
198
221
|
* @param {CurrentUserOpts} - options for getting the current user
|
|
222
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
199
223
|
* @return - A promise resolves to current authenticated CognitoUser if success
|
|
200
224
|
*/
|
|
201
225
|
currentAuthenticatedUser(params?: CurrentUserOpts, customUserAgentDetails?: CustomUserAgentDetails): Promise<CognitoUser | any>;
|
|
202
226
|
/**
|
|
203
227
|
* Get current user's session
|
|
228
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
204
229
|
* @return - A promise resolves to session object if success
|
|
205
230
|
*/
|
|
206
231
|
currentSession(customUserAgentDetails?: CustomUserAgentDetails): Promise<CognitoUserSession>;
|
|
@@ -208,11 +233,13 @@ export declare class InternalAuthClass {
|
|
|
208
233
|
/**
|
|
209
234
|
* Get the corresponding user session
|
|
210
235
|
* @param {Object} user - The CognitoUser object
|
|
236
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
211
237
|
* @return - A promise resolves to the session
|
|
212
238
|
*/
|
|
213
239
|
userSession(user: any, customUserAgentDetails?: CustomUserAgentDetails): Promise<CognitoUserSession>;
|
|
214
240
|
/**
|
|
215
241
|
* Get authenticated credentials of current user.
|
|
242
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
216
243
|
* @return - A promise resolves to be current user's credentials
|
|
217
244
|
*/
|
|
218
245
|
currentUserCredentials(customUserAgentDetails?: CustomUserAgentDetails): Promise<ICredentials>;
|
|
@@ -229,6 +256,7 @@ export declare class InternalAuthClass {
|
|
|
229
256
|
* @param {Object} user - The CognitoUser
|
|
230
257
|
* @param {Object} attr - The attribute to be verified
|
|
231
258
|
* @param {String} code - The confirmation code
|
|
259
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
232
260
|
* @return - A promise resolves to callback data if success
|
|
233
261
|
*/
|
|
234
262
|
verifyUserAttributeSubmit(user: CognitoUser | any, attr: string, code: string, customUserAgentDetails?: CustomUserAgentDetails): Promise<string>;
|
|
@@ -237,6 +265,7 @@ export declare class InternalAuthClass {
|
|
|
237
265
|
* Confirm current user's attribute using a confirmation code
|
|
238
266
|
* @param {Object} attr - The attribute to be verified
|
|
239
267
|
* @param {String} code - The confirmation code
|
|
268
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
240
269
|
* @return - A promise resolves to callback data if success
|
|
241
270
|
*/
|
|
242
271
|
verifyCurrentUserAttributeSubmit(attr: string, code: string, customUserAgentDetails?: CustomUserAgentDetails): Promise<string>;
|
|
@@ -246,7 +275,8 @@ export declare class InternalAuthClass {
|
|
|
246
275
|
private oAuthSignOutRedirectOrReject;
|
|
247
276
|
/**
|
|
248
277
|
* Sign out method
|
|
249
|
-
* @
|
|
278
|
+
* @param {SignOutOpts} opts - options for sign out
|
|
279
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
250
280
|
* @return - A promise resolved if success
|
|
251
281
|
*/
|
|
252
282
|
signOut(opts?: SignOutOpts, customUserAgentDetails?: CustomUserAgentDetails): Promise<any>;
|
|
@@ -256,12 +286,16 @@ export declare class InternalAuthClass {
|
|
|
256
286
|
* @param {Object} user - The CognitoUser object
|
|
257
287
|
* @param {String} oldPassword - the current password
|
|
258
288
|
* @param {String} newPassword - the requested new password
|
|
289
|
+
* @param {ClientMetaData} clientMetadata - optional client metadata, defaults to config
|
|
290
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
259
291
|
* @return - A promise resolves if success
|
|
260
292
|
*/
|
|
261
293
|
changePassword(user: CognitoUser | any, oldPassword: string, newPassword: string, clientMetadata?: ClientMetaData, customUserAgentDetails?: CustomUserAgentDetails): Promise<'SUCCESS'>;
|
|
262
294
|
/**
|
|
263
295
|
* Initiate a forgot password request
|
|
264
296
|
* @param {String} username - the username to change password
|
|
297
|
+
* @param {ClientMetaData} clientMetadata - optional client metadata, defaults to config
|
|
298
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
265
299
|
* @return - A promise resolves if success
|
|
266
300
|
*/
|
|
267
301
|
forgotPassword(username: string, clientMetadata?: ClientMetaData, customUserAgentDetails?: CustomUserAgentDetails): Promise<any>;
|
|
@@ -270,12 +304,15 @@ export declare class InternalAuthClass {
|
|
|
270
304
|
* @param {String} username - The username
|
|
271
305
|
* @param {String} code - The confirmation code
|
|
272
306
|
* @param {String} password - The new password
|
|
307
|
+
* @param {ClientMetaData} clientMetadata - optional client metadata, defaults to config
|
|
308
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
273
309
|
* @return - A promise that resolves if success
|
|
274
310
|
*/
|
|
275
311
|
forgotPasswordSubmit(username: string, code: string, password: string, clientMetadata?: ClientMetaData, customUserAgentDetails?: CustomUserAgentDetails): Promise<string>;
|
|
276
312
|
/**
|
|
277
313
|
* Get user information
|
|
278
314
|
* @async
|
|
315
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
279
316
|
* @return {Object }- current User's information
|
|
280
317
|
*/
|
|
281
318
|
currentUserInfo(customUserAgentDetails?: CustomUserAgentDetails): Promise<any>;
|
|
@@ -290,7 +327,7 @@ export declare class InternalAuthClass {
|
|
|
290
327
|
* @param {Object} credentials
|
|
291
328
|
* @return {Object} - Credentials
|
|
292
329
|
*/
|
|
293
|
-
essentialCredentials(credentials: any
|
|
330
|
+
essentialCredentials(credentials: any): ICredentials;
|
|
294
331
|
private attributesToObject;
|
|
295
332
|
private isTruthyString;
|
|
296
333
|
private createCognitoUser;
|
|
@@ -181,20 +181,7 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
181
181
|
}
|
|
182
182
|
return this._config;
|
|
183
183
|
};
|
|
184
|
-
|
|
185
|
-
* Sign up with username, password and other attributes like phone, email
|
|
186
|
-
* @param {String | object} params - The user attributes used for signin
|
|
187
|
-
* @param {String[]} restOfAttrs - for the backward compatability
|
|
188
|
-
* @return - A promise resolves callback data if success
|
|
189
|
-
*/
|
|
190
|
-
InternalAuthClass.prototype.signUp = function (params) {
|
|
191
|
-
var restOfAttrs = [];
|
|
192
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
193
|
-
restOfAttrs[_i - 1] = arguments[_i];
|
|
194
|
-
}
|
|
195
|
-
return this.internalSignUp(params, restOfAttrs);
|
|
196
|
-
};
|
|
197
|
-
InternalAuthClass.prototype.internalSignUp = function (params, restOfAttrs, customUserAgentDetails) {
|
|
184
|
+
InternalAuthClass.prototype.signUp = function (params, restOfAttrs, customUserAgentDetails) {
|
|
198
185
|
var _this = this;
|
|
199
186
|
var _a, _b, _c;
|
|
200
187
|
if (!this.userPool) {
|
|
@@ -365,6 +352,7 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
365
352
|
* @param {String} username - The username to be confirmed
|
|
366
353
|
* @param {String} code - The verification code
|
|
367
354
|
* @param {ConfirmSignUpOptions} options - other options for confirm signup
|
|
355
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
368
356
|
* @return - A promise resolves callback data if success
|
|
369
357
|
*/
|
|
370
358
|
InternalAuthClass.prototype.confirmSignUp = function (username, code, options, customUserAgentDetails) {
|
|
@@ -414,6 +402,7 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
414
402
|
* Resend the verification code
|
|
415
403
|
* @param {String} username - The username to be confirmed
|
|
416
404
|
* @param {ClientMetadata} clientMetadata - Metadata to be passed to Cognito Lambda triggers
|
|
405
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
417
406
|
* @return - A promise resolves code delivery details if successful
|
|
418
407
|
*/
|
|
419
408
|
InternalAuthClass.prototype.resendSignUp = function (username, clientMetadata, customUserAgentDetails) {
|
|
@@ -625,6 +614,7 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
625
614
|
* how to setup and use MFA: https://docs.amplify.aws/lib/auth/mfa/q/platform/js
|
|
626
615
|
* @deprecated
|
|
627
616
|
* @param {CognitoUser} user - the current user
|
|
617
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
628
618
|
* @return - A promise resolves the current preferred mfa option if success
|
|
629
619
|
*/
|
|
630
620
|
InternalAuthClass.prototype.getMFAOptions = function (user, customUserAgentDetails) {
|
|
@@ -645,6 +635,7 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
645
635
|
* get preferred mfa method
|
|
646
636
|
* @param {CognitoUser} user - the current cognito user
|
|
647
637
|
* @param {GetPreferredMFAOpts} params - options for getting the current user preferred MFA
|
|
638
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
648
639
|
*/
|
|
649
640
|
InternalAuthClass.prototype.getPreferredMFA = function (user, params, customUserAgentDetails) {
|
|
650
641
|
var _this = this;
|
|
@@ -761,6 +752,7 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
761
752
|
* set preferred MFA method
|
|
762
753
|
* @param {CognitoUser} user - the current Cognito user
|
|
763
754
|
* @param {string} mfaMethod - preferred mfa method
|
|
755
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
764
756
|
* @return - A promise resolve if success
|
|
765
757
|
*/
|
|
766
758
|
InternalAuthClass.prototype.setPreferredMFA = function (user, mfaMethod, customUserAgentDetails) {
|
|
@@ -894,6 +886,7 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
894
886
|
* disable SMS
|
|
895
887
|
* @deprecated
|
|
896
888
|
* @param {CognitoUser} user - the current user
|
|
889
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
897
890
|
* @return - A promise resolves is success
|
|
898
891
|
*/
|
|
899
892
|
InternalAuthClass.prototype.disableSMS = function (user, customUserAgentDetails) {
|
|
@@ -914,6 +907,7 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
914
907
|
* enable SMS
|
|
915
908
|
* @deprecated
|
|
916
909
|
* @param {CognitoUser} user - the current user
|
|
910
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
917
911
|
* @return - A promise resolves is success
|
|
918
912
|
*/
|
|
919
913
|
InternalAuthClass.prototype.enableSMS = function (user, customUserAgentDetails) {
|
|
@@ -933,6 +927,7 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
933
927
|
/**
|
|
934
928
|
* Setup TOTP
|
|
935
929
|
* @param {CognitoUser} user - the current user
|
|
930
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
936
931
|
* @return - A promise resolves with the secret code if success
|
|
937
932
|
*/
|
|
938
933
|
InternalAuthClass.prototype.setupTOTP = function (user, customUserAgentDetails) {
|
|
@@ -955,6 +950,7 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
955
950
|
* verify TOTP setup
|
|
956
951
|
* @param {CognitoUser} user - the current user
|
|
957
952
|
* @param {string} challengeAnswer - challenge answer
|
|
953
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
958
954
|
* @return - A promise resolves is success
|
|
959
955
|
*/
|
|
960
956
|
InternalAuthClass.prototype.verifyTotpToken = function (user, challengeAnswer, customUserAgentDetails) {
|
|
@@ -987,6 +983,9 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
987
983
|
* Send MFA code to confirm sign in
|
|
988
984
|
* @param {Object} user - The CognitoUser object
|
|
989
985
|
* @param {String} code - The confirmation code
|
|
986
|
+
* @param {string} mfaType - optional mfaType: 'SMS_MFA' | 'SOFTWARE_TOKEN_MFA'
|
|
987
|
+
* @param {ClientMetaData} clientMetadata - optional client metadata defaults to config
|
|
988
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
990
989
|
*/
|
|
991
990
|
InternalAuthClass.prototype.confirmSignIn = function (user, code, mfaType, clientMetadata, customUserAgentDetails) {
|
|
992
991
|
var _this = this;
|
|
@@ -1117,6 +1116,8 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
1117
1116
|
* Send the answer to a custom challenge
|
|
1118
1117
|
* @param {CognitoUser} user - The CognitoUser object
|
|
1119
1118
|
* @param {String} challengeResponses - The confirmation code
|
|
1119
|
+
* @param {ClientMetaData} clientMetadata - optional client metadata defaults to config
|
|
1120
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
1120
1121
|
*/
|
|
1121
1122
|
InternalAuthClass.prototype.sendCustomChallengeAnswer = function (user, challengeResponses, clientMetadata, customUserAgentDetails) {
|
|
1122
1123
|
var _this = this;
|
|
@@ -1134,7 +1135,9 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
1134
1135
|
};
|
|
1135
1136
|
/**
|
|
1136
1137
|
* Delete an authenticated users' attributes
|
|
1137
|
-
* @param {CognitoUser} - The currently logged in user object
|
|
1138
|
+
* @param {CognitoUser} user - The currently logged in user object
|
|
1139
|
+
* @param {string[]} attributeNames - Attributes to delete
|
|
1140
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
1138
1141
|
* @return {Promise}
|
|
1139
1142
|
**/
|
|
1140
1143
|
InternalAuthClass.prototype.deleteUserAttributes = function (user, attributeNames, customUserAgentDetails) {
|
|
@@ -1154,6 +1157,7 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
1154
1157
|
};
|
|
1155
1158
|
/**
|
|
1156
1159
|
* Delete the current authenticated user
|
|
1160
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
1157
1161
|
* @return {Promise}
|
|
1158
1162
|
**/
|
|
1159
1163
|
// TODO: Check return type void
|
|
@@ -1253,7 +1257,10 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
1253
1257
|
};
|
|
1254
1258
|
/**
|
|
1255
1259
|
* Update an authenticated users' attributes
|
|
1256
|
-
* @param {CognitoUser} - The currently logged in user object
|
|
1260
|
+
* @param {CognitoUser} user - The currently logged in user object
|
|
1261
|
+
* @param {object} attributes - attributes to update
|
|
1262
|
+
* @param {ClientMetaData} clientMetadata - optional client metadata, defaults to config
|
|
1263
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
1257
1264
|
* @return {Promise}
|
|
1258
1265
|
**/
|
|
1259
1266
|
InternalAuthClass.prototype.updateUserAttributes = function (user, attributes, clientMetadata, customUserAgentDetails) {
|
|
@@ -1303,6 +1310,7 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
1303
1310
|
/**
|
|
1304
1311
|
* Return user attributes
|
|
1305
1312
|
* @param {Object} user - The CognitoUser object
|
|
1313
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
1306
1314
|
* @return - A promise resolves to user attributes if success
|
|
1307
1315
|
*/
|
|
1308
1316
|
InternalAuthClass.prototype.userAttributes = function (user, customUserAgentDetails) {
|
|
@@ -1423,6 +1431,8 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
1423
1431
|
};
|
|
1424
1432
|
/**
|
|
1425
1433
|
* Get current authenticated user
|
|
1434
|
+
* @param {CurrentUserOpts} params - options for getting the current user
|
|
1435
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
1426
1436
|
* @return - A promise resolves to current authenticated CognitoUser if success
|
|
1427
1437
|
*/
|
|
1428
1438
|
InternalAuthClass.prototype.currentUserPoolUser = function (params, customUserAgentDetails) {
|
|
@@ -1555,6 +1565,7 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
1555
1565
|
/**
|
|
1556
1566
|
* Get current authenticated user
|
|
1557
1567
|
* @param {CurrentUserOpts} - options for getting the current user
|
|
1568
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
1558
1569
|
* @return - A promise resolves to current authenticated CognitoUser if success
|
|
1559
1570
|
*/
|
|
1560
1571
|
InternalAuthClass.prototype.currentAuthenticatedUser = function (params, customUserAgentDetails) {
|
|
@@ -1617,6 +1628,7 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
1617
1628
|
};
|
|
1618
1629
|
/**
|
|
1619
1630
|
* Get current user's session
|
|
1631
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
1620
1632
|
* @return - A promise resolves to session object if success
|
|
1621
1633
|
*/
|
|
1622
1634
|
InternalAuthClass.prototype.currentSession = function (customUserAgentDetails) {
|
|
@@ -1718,6 +1730,7 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
1718
1730
|
/**
|
|
1719
1731
|
* Get the corresponding user session
|
|
1720
1732
|
* @param {Object} user - The CognitoUser object
|
|
1733
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
1721
1734
|
* @return - A promise resolves to the session
|
|
1722
1735
|
*/
|
|
1723
1736
|
InternalAuthClass.prototype.userSession = function (user, customUserAgentDetails) {
|
|
@@ -1725,6 +1738,7 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
1725
1738
|
};
|
|
1726
1739
|
/**
|
|
1727
1740
|
* Get authenticated credentials of current user.
|
|
1741
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
1728
1742
|
* @return - A promise resolves to be current user's credentials
|
|
1729
1743
|
*/
|
|
1730
1744
|
InternalAuthClass.prototype.currentUserCredentials = function (customUserAgentDetails) {
|
|
@@ -1802,6 +1816,7 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
1802
1816
|
* @param {Object} user - The CognitoUser
|
|
1803
1817
|
* @param {Object} attr - The attribute to be verified
|
|
1804
1818
|
* @param {String} code - The confirmation code
|
|
1819
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
1805
1820
|
* @return - A promise resolves to callback data if success
|
|
1806
1821
|
*/
|
|
1807
1822
|
InternalAuthClass.prototype.verifyUserAttributeSubmit = function (user, attr, code, customUserAgentDetails) {
|
|
@@ -1831,6 +1846,7 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
1831
1846
|
* Confirm current user's attribute using a confirmation code
|
|
1832
1847
|
* @param {Object} attr - The attribute to be verified
|
|
1833
1848
|
* @param {String} code - The confirmation code
|
|
1849
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
1834
1850
|
* @return - A promise resolves to callback data if success
|
|
1835
1851
|
*/
|
|
1836
1852
|
InternalAuthClass.prototype.verifyCurrentUserAttributeSubmit = function (attr, code, customUserAgentDetails) {
|
|
@@ -1942,7 +1958,8 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
1942
1958
|
};
|
|
1943
1959
|
/**
|
|
1944
1960
|
* Sign out method
|
|
1945
|
-
* @
|
|
1961
|
+
* @param {SignOutOpts} opts - options for sign out
|
|
1962
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
1946
1963
|
* @return - A promise resolved if success
|
|
1947
1964
|
*/
|
|
1948
1965
|
InternalAuthClass.prototype.signOut = function (opts, customUserAgentDetails) {
|
|
@@ -2009,6 +2026,8 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
2009
2026
|
* @param {Object} user - The CognitoUser object
|
|
2010
2027
|
* @param {String} oldPassword - the current password
|
|
2011
2028
|
* @param {String} newPassword - the requested new password
|
|
2029
|
+
* @param {ClientMetaData} clientMetadata - optional client metadata, defaults to config
|
|
2030
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
2012
2031
|
* @return - A promise resolves if success
|
|
2013
2032
|
*/
|
|
2014
2033
|
InternalAuthClass.prototype.changePassword = function (user, oldPassword, newPassword, clientMetadata, customUserAgentDetails) {
|
|
@@ -2031,6 +2050,8 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
2031
2050
|
/**
|
|
2032
2051
|
* Initiate a forgot password request
|
|
2033
2052
|
* @param {String} username - the username to change password
|
|
2053
|
+
* @param {ClientMetaData} clientMetadata - optional client metadata, defaults to config
|
|
2054
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
2034
2055
|
* @return - A promise resolves if success
|
|
2035
2056
|
*/
|
|
2036
2057
|
InternalAuthClass.prototype.forgotPassword = function (username, clientMetadata, customUserAgentDetails) {
|
|
@@ -2067,6 +2088,8 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
2067
2088
|
* @param {String} username - The username
|
|
2068
2089
|
* @param {String} code - The confirmation code
|
|
2069
2090
|
* @param {String} password - The new password
|
|
2091
|
+
* @param {ClientMetaData} clientMetadata - optional client metadata, defaults to config
|
|
2092
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
2070
2093
|
* @return - A promise that resolves if success
|
|
2071
2094
|
*/
|
|
2072
2095
|
InternalAuthClass.prototype.forgotPasswordSubmit = function (username, code, password, clientMetadata, customUserAgentDetails) {
|
|
@@ -2102,6 +2125,7 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
2102
2125
|
/**
|
|
2103
2126
|
* Get user information
|
|
2104
2127
|
* @async
|
|
2128
|
+
* @param {CustomUserAgentDetails} customUserAgentDetails - Optional parameter to send user agent details
|
|
2105
2129
|
* @return {Object }- current User's information
|
|
2106
2130
|
*/
|
|
2107
2131
|
InternalAuthClass.prototype.currentUserInfo = function (customUserAgentDetails) {
|
|
@@ -2227,7 +2251,7 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
2227
2251
|
* Used to complete the OAuth flow with or without the Cognito Hosted UI
|
|
2228
2252
|
* @param {String} URL - optional parameter for customers to pass in the response URL
|
|
2229
2253
|
*/
|
|
2230
|
-
InternalAuthClass.prototype._handleAuthResponse = function (URL
|
|
2254
|
+
InternalAuthClass.prototype._handleAuthResponse = function (URL) {
|
|
2231
2255
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2232
2256
|
var currentUrl, hasCodeOrError, hasTokenOrError, _a, accessToken, idToken, refreshToken, state, session, credentials, isCustomStateIncluded, currentUser, customState, err_3;
|
|
2233
2257
|
return tslib_1.__generator(this, function (_b) {
|
|
@@ -2327,7 +2351,7 @@ var InternalAuthClass = /** @class */ (function () {
|
|
|
2327
2351
|
* @param {Object} credentials
|
|
2328
2352
|
* @return {Object} - Credentials
|
|
2329
2353
|
*/
|
|
2330
|
-
InternalAuthClass.prototype.essentialCredentials = function (credentials
|
|
2354
|
+
InternalAuthClass.prototype.essentialCredentials = function (credentials) {
|
|
2331
2355
|
return {
|
|
2332
2356
|
accessKeyId: credentials.accessKeyId,
|
|
2333
2357
|
sessionToken: credentials.sessionToken,
|