@aws-amplify/ui-angular 2.4.19 → 2.4.21
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/aws-amplify-ui-angular.metadata.json +1 -1
- package/bundles/aws-amplify-ui-angular.umd.js +27 -19
- package/bundles/aws-amplify-ui-angular.umd.js.map +1 -1
- package/bundles/aws-amplify-ui-angular.umd.min.js +1 -1
- package/bundles/aws-amplify-ui-angular.umd.min.js.map +1 -1
- package/esm2015/lib/components/authenticator/components/confirm-sign-in/confirm-sign-in.component.js +4 -4
- package/esm2015/lib/components/authenticator/components/setup-totp/setup-totp.component.js +9 -8
- package/esm2015/lib/services/authenticator.service.js +1 -1
- package/fesm2015/aws-amplify-ui-angular.js +10 -9
- package/fesm2015/aws-amplify-ui-angular.js.map +1 -1
- package/lib/components/authenticator/components/authenticator/authenticator.component.d.ts +11 -15
- package/lib/components/authenticator/components/confirm-reset-password/amplify-confirm-reset-password.component.d.ts +10 -14
- package/lib/components/authenticator/components/confirm-sign-in/confirm-sign-in.component.d.ts +10 -14
- package/lib/components/authenticator/components/confirm-sign-up/confirm-sign-up.component.d.ts +10 -14
- package/lib/components/authenticator/components/confirm-verify-user/amplify-confirm-verify-user.component.d.ts +10 -14
- package/lib/components/authenticator/components/force-new-password/force-new-password.component.d.ts +10 -14
- package/lib/components/authenticator/components/reset-password/reset-password.component.d.ts +10 -14
- package/lib/components/authenticator/components/setup-totp/setup-totp.component.d.ts +12 -17
- package/lib/components/authenticator/components/sign-in/sign-in.component.d.ts +10 -14
- package/lib/components/authenticator/components/sign-up/sign-up.component.d.ts +10 -14
- package/lib/components/authenticator/components/verify-user/verify-user.component.d.ts +10 -14
- package/lib/services/authenticator.service.d.ts +15 -25
- package/package.json +3 -3
|
@@ -536,10 +536,10 @@
|
|
|
536
536
|
var actorContext = ui.getActorContext(state);
|
|
537
537
|
var challengeName = actorContext.challengeName;
|
|
538
538
|
switch (challengeName) {
|
|
539
|
-
case
|
|
539
|
+
case 'SOFTWARE_TOKEN_MFA':
|
|
540
540
|
this.headerText = ui.translate('Confirm TOTP Code');
|
|
541
541
|
break;
|
|
542
|
-
case
|
|
542
|
+
case 'SMS_MFA':
|
|
543
543
|
this.headerText = ui.translate('Confirm SMS Code');
|
|
544
544
|
break;
|
|
545
545
|
default:
|
|
@@ -1240,7 +1240,16 @@
|
|
|
1240
1240
|
this.confirmText = ui.translate('Confirm');
|
|
1241
1241
|
}
|
|
1242
1242
|
SetupTotpComponent.prototype.ngOnInit = function () {
|
|
1243
|
-
this
|
|
1243
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1244
|
+
return __generator(this, function (_c) {
|
|
1245
|
+
switch (_c.label) {
|
|
1246
|
+
case 0: return [4 /*yield*/, this.generateQRCode()];
|
|
1247
|
+
case 1:
|
|
1248
|
+
_c.sent();
|
|
1249
|
+
return [2 /*return*/];
|
|
1250
|
+
}
|
|
1251
|
+
});
|
|
1252
|
+
});
|
|
1244
1253
|
};
|
|
1245
1254
|
Object.defineProperty(SetupTotpComponent.prototype, "context", {
|
|
1246
1255
|
get: function () {
|
|
@@ -1250,33 +1259,32 @@
|
|
|
1250
1259
|
configurable: true
|
|
1251
1260
|
});
|
|
1252
1261
|
SetupTotpComponent.prototype.generateQRCode = function () {
|
|
1253
|
-
var _a, _b
|
|
1262
|
+
var _a, _b;
|
|
1254
1263
|
return __awaiter(this, void 0, void 0, function () {
|
|
1255
|
-
var state, actorContext, user,
|
|
1256
|
-
return __generator(this, function (
|
|
1257
|
-
switch (
|
|
1264
|
+
var state, actorContext, user, formFields, _c, _d, totpIssuer, _e, totpUsername, _f, totpCode, _g, err_1;
|
|
1265
|
+
return __generator(this, function (_h) {
|
|
1266
|
+
switch (_h.label) {
|
|
1258
1267
|
case 0:
|
|
1259
1268
|
state = this.authenticator.authState;
|
|
1260
1269
|
actorContext = ui.getActorContext(state);
|
|
1261
|
-
user = actorContext.user;
|
|
1262
|
-
|
|
1270
|
+
user = actorContext.user, formFields = actorContext.formFields;
|
|
1271
|
+
_c = (_b = (_a = formFields === null || formFields === void 0 ? void 0 : formFields.setupTOTP) === null || _a === void 0 ? void 0 : _a.QR) !== null && _b !== void 0 ? _b : {}, _d = _c.totpIssuer, totpIssuer = _d === void 0 ? 'AWSCognito' : _d, _e = _c.totpUsername, totpUsername = _e === void 0 ? user === null || user === void 0 ? void 0 : user.username : _e;
|
|
1272
|
+
_h.label = 1;
|
|
1263
1273
|
case 1:
|
|
1264
|
-
|
|
1265
|
-
|
|
1274
|
+
_h.trys.push([1, 4, , 5]);
|
|
1275
|
+
_f = this;
|
|
1266
1276
|
return [4 /*yield*/, awsAmplify.Auth.setupTOTP(user)];
|
|
1267
1277
|
case 2:
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
username = (_f = (_e = (_d = this.formOverrides) === null || _d === void 0 ? void 0 : _d['QR']) === null || _e === void 0 ? void 0 : _e.totpUsername) !== null && _f !== void 0 ? _f : user.username;
|
|
1271
|
-
totpCode = encodeURI("otpauth://totp/" + issuer + ":" + username + "?secret=" + this.secretKey + "&issuer=" + issuer);
|
|
1278
|
+
_f.secretKey = _h.sent();
|
|
1279
|
+
totpCode = ui.getTotpCode(totpIssuer, totpUsername, this.secretKey);
|
|
1272
1280
|
logger.info('totp code was generated:', totpCode);
|
|
1273
|
-
|
|
1281
|
+
_g = this;
|
|
1274
1282
|
return [4 /*yield*/, QRCode__default["default"].toDataURL(totpCode)];
|
|
1275
1283
|
case 3:
|
|
1276
|
-
|
|
1284
|
+
_g.qrCodeSource = _h.sent();
|
|
1277
1285
|
return [3 /*break*/, 5];
|
|
1278
1286
|
case 4:
|
|
1279
|
-
err_1 =
|
|
1287
|
+
err_1 = _h.sent();
|
|
1280
1288
|
logger.error(err_1);
|
|
1281
1289
|
return [3 /*break*/, 5];
|
|
1282
1290
|
case 5: return [2 /*return*/];
|
|
@@ -1286,7 +1294,7 @@
|
|
|
1286
1294
|
};
|
|
1287
1295
|
SetupTotpComponent.prototype.onInput = function (event) {
|
|
1288
1296
|
event.preventDefault();
|
|
1289
|
-
var
|
|
1297
|
+
var _c = event.target, name = _c.name, value = _c.value;
|
|
1290
1298
|
this.authenticator.updateForm({ name: name, value: value });
|
|
1291
1299
|
};
|
|
1292
1300
|
SetupTotpComponent.prototype.onSubmit = function (event) {
|