@aws-amplify/ui-angular 3.2.4 → 3.2.6
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/bundles/aws-amplify-ui-angular.umd.js +27 -22
- package/bundles/aws-amplify-ui-angular.umd.js.map +1 -1
- package/esm2015/lib/components/authenticator/components/federated-sign-in/federated-sign-in.component.js +4 -3
- package/esm2015/lib/components/authenticator/components/setup-totp/setup-totp.component.js +9 -11
- package/esm2015/lib/services/authenticator.service.js +5 -1
- package/esm2015/version.js +2 -2
- package/fesm2015/aws-amplify-ui-angular.js +16 -13
- package/fesm2015/aws-amplify-ui-angular.js.map +1 -1
- package/lib/components/authenticator/components/authenticator/authenticator.component.d.ts +1 -0
- package/lib/components/authenticator/components/confirm-reset-password/amplify-confirm-reset-password.component.d.ts +1 -0
- package/lib/components/authenticator/components/confirm-sign-in/confirm-sign-in.component.d.ts +1 -0
- package/lib/components/authenticator/components/confirm-sign-up/confirm-sign-up.component.d.ts +1 -0
- package/lib/components/authenticator/components/confirm-verify-user/amplify-confirm-verify-user.component.d.ts +1 -0
- package/lib/components/authenticator/components/federated-sign-in/federated-sign-in.component.d.ts +1 -0
- package/lib/components/authenticator/components/force-new-password/force-new-password.component.d.ts +1 -0
- package/lib/components/authenticator/components/reset-password/reset-password.component.d.ts +1 -0
- package/lib/components/authenticator/components/setup-totp/setup-totp.component.d.ts +2 -1
- package/lib/components/authenticator/components/sign-in/sign-in.component.d.ts +1 -0
- package/lib/components/authenticator/components/sign-up/sign-up.component.d.ts +1 -0
- package/lib/components/authenticator/components/verify-user/verify-user.component.d.ts +1 -0
- package/lib/services/authenticator.service.d.ts +2 -0
- package/package.json +2 -2
- package/version.d.ts +1 -1
|
@@ -408,7 +408,7 @@
|
|
|
408
408
|
}]
|
|
409
409
|
}] });
|
|
410
410
|
|
|
411
|
-
var VERSION = '3.2.
|
|
411
|
+
var VERSION = '3.2.6';
|
|
412
412
|
|
|
413
413
|
var logger$1 = new core.Logger('state-machine');
|
|
414
414
|
/**
|
|
@@ -500,6 +500,14 @@
|
|
|
500
500
|
enumerable: false,
|
|
501
501
|
configurable: true
|
|
502
502
|
});
|
|
503
|
+
Object.defineProperty(AuthenticatorService.prototype, "totpSecretCode", {
|
|
504
|
+
get: function () {
|
|
505
|
+
var _a;
|
|
506
|
+
return (_a = this._facade) === null || _a === void 0 ? void 0 : _a.totpSecretCode;
|
|
507
|
+
},
|
|
508
|
+
enumerable: false,
|
|
509
|
+
configurable: true
|
|
510
|
+
});
|
|
503
511
|
Object.defineProperty(AuthenticatorService.prototype, "initializeMachine", {
|
|
504
512
|
/**
|
|
505
513
|
* Service facades
|
|
@@ -868,7 +876,7 @@
|
|
|
868
876
|
type: i0.Input
|
|
869
877
|
}] } });
|
|
870
878
|
|
|
871
|
-
var getSignInWithFederationText = ui.authenticatorTextUtil.getSignInWithFederationText;
|
|
879
|
+
var getSignInWithFederationText = ui.authenticatorTextUtil.getSignInWithFederationText, getOrText = ui.authenticatorTextUtil.getOrText;
|
|
872
880
|
var FederatedSignInComponent = /** @class */ (function () {
|
|
873
881
|
function FederatedSignInComponent(authenticator) {
|
|
874
882
|
this.authenticator = authenticator;
|
|
@@ -895,6 +903,7 @@
|
|
|
895
903
|
};
|
|
896
904
|
FederatedSignInComponent.prototype.setFederatedTexts = function () {
|
|
897
905
|
var route = this.authenticator.route;
|
|
906
|
+
this.orText = getOrText();
|
|
898
907
|
this.signInAmazonText = getSignInWithFederationText(route, 'amazon');
|
|
899
908
|
this.signInAppleText = getSignInWithFederationText(route, 'apple');
|
|
900
909
|
this.signInFacebookText = getSignInWithFederationText(route, 'facebook');
|
|
@@ -903,7 +912,7 @@
|
|
|
903
912
|
return FederatedSignInComponent;
|
|
904
913
|
}());
|
|
905
914
|
FederatedSignInComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FederatedSignInComponent, deps: [{ token: AuthenticatorService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
906
|
-
FederatedSignInComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FederatedSignInComponent, selector: "amplify-federated-sign-in", ngImport: i0__namespace, template: "<div\n class=\"amplify-flex federated-sign-in-container\"\n *ngIf=\"shouldShowFederatedSignIn\"\n data-orientation=\"horizontal\"\n data-size=\"small\"\n>\n <amplify-federated-sign-in-button\n *ngIf=\"includeAmazon\"\n [text]=\"signInAmazonText\"\n [provider]=\"FederatedProviders.Amazon\"\n >\n <svg\n aria-label=\"Amazon icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 248 268\"\n >\n <path\n d=\"M139.056521,147.024612 C133.548808,156.744524 124.782731,162.726926 115.087401,162.726926 C101.790721,162.726926 93.9937779,152.612964 93.9937779,137.68681 C93.9937779,108.224571 120.447551,102.879017 145.533369,102.879017 L145.533369,110.365976 C145.533369,123.831358 145.876354,135.063787 139.056521,147.024612 M207.206992,162.579655 C209.400505,165.692256 209.887066,169.437725 207.063416,171.770186 C199.996315,177.653081 187.429476,188.590967 180.513926,194.716661 L180.46208,194.621133 C178.176838,196.663031 174.862638,196.810303 172.27828,195.445057 C160.780281,185.9162 158.686473,181.494078 152.405048,172.403055 C133.405233,191.751331 119.909143,197.534719 95.309886,197.534719 C66.1281801,197.534719 43.4791563,179.599451 43.4791563,143.669212 C43.4791563,115.616003 58.6782107,96.5105248 80.4019706,87.1727225 C99.2063636,78.9096034 125.464714,77.4528107 145.533369,75.1641337 L145.533369,70.694248 C145.533369,62.4749122 146.167493,52.7510201 141.297893,45.6541312 C137.110277,39.2856386 129.018206,36.6586354 121.859376,36.6586354 C108.658413,36.6586354 96.9171331,43.4171982 94.0416364,57.4199213 C93.4593582,60.532522 91.1701278,63.5933787 88.003492,63.7406501 L54.4387473,60.1424518 C51.6150972,59.5095829 48.4484614,57.2248862 49.2740201,52.8982915 C56.9712583,12.2553679 93.7983558,0 126.732964,0 C143.587124,0 165.606011,4.47386604 178.902691,17.2148315 C195.760839,32.917146 194.149604,53.8694866 194.149604,76.6726704 L194.149604,130.542157 C194.149604,146.734049 200.87372,153.830938 207.206992,162.579655 Z M233.826346,208.038962 C230.467669,203.683255 211.550709,205.9821 203.056405,206.998432 C200.470662,207.321077 200.076227,205.042397 202.406981,203.404973 C217.475208,192.664928 242.201125,195.766353 245.081698,199.363845 C247.966255,202.981502 244.336653,228.071183 230.172839,240.049379 C228.001452,241.888455 225.929671,240.904388 226.89783,238.468418 C230.077218,230.430525 237.204944,212.418868 233.826346,208.038962 Z M126.768855,264 C74.0234043,264 42.0764048,241.955028 17.7852554,217.541992 C12.9733903,212.705982 6.71799208,206.295994 3.31151296,200.690918 C1.90227474,198.372135 5.59096074,195.021875 8.0442063,196.84375 C38.2390146,219.267578 82.1011654,239.538304 125.529506,239.538304 C154.819967,239.538304 191.046475,227.469543 220.66851,214.867659 C225.146771,212.966167 225.146771,219.180222 224.511585,221.060516 C224.183264,222.03242 209.514625,236.221149 189.247207,247.047411 C170.304273,257.166172 146.397132,264 126.768855,264 Z\"\n fill=\"#FF9900\"\n ></path>\n </svg>\n\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInAmazonText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeApple\"\n [provider]=\"FederatedProviders.Apple\"\n >\n <svg\n aria-label=\"Apple icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n fill=\"#000\"\n preserveAspectRatio=\"xMidYMid\"\n stroke=\"#000\"\n strokeWidth=\"0\"\n viewBox=\"0 0 1024 1024\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M747.4 535.7c-.4-68.2 30.5-119.6 92.9-157.5-34.9-50-87.7-77.5-157.3-82.8-65.9-5.2-138 38.4-164.4 38.4-27.9 0-91.7-36.6-141.9-36.6C273.1 298.8 163 379.8 163 544.6c0 48.7 8.9 99 26.7 150.8 23.8 68.2 109.6 235.3 199.1 232.6 46.8-1.1 79.9-33.2 140.8-33.2 59.1 0 89.7 33.2 141.9 33.2 90.3-1.3 167.9-153.2 190.5-221.6-121.1-57.1-114.6-167.2-114.6-170.7zm-105.1-305c50.7-60.2 46.1-115 44.6-134.7-44.8 2.6-96.6 30.5-126.1 64.8-32.5 36.8-51.6 82.3-47.5 133.6 48.4 3.7 92.6-21.2 129-63.7z\"\n ></path>\n </svg>\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInAppleText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeFacebook\"\n [text]=\"signInFacebookText\"\n [provider]=\"FederatedProviders.Facebook\"\n >\n <svg\n aria-label=\"Facebook icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 279 538\"\n >\n <path\n d=\"M82.3409742,538 L82.3409742,292.936652 L0,292.936652 L0,196.990154 L82.2410458,196.990154 L82.2410458,126.4295 C82.2410458,44.575144 132.205229,0 205.252865,0 C240.227794,0 270.306232,2.59855099 279,3.79788222 L279,89.2502322 L228.536175,89.2502322 C188.964542,89.2502322 181.270057,108.139699 181.270057,135.824262 L181.270057,196.89021 L276.202006,196.89021 L263.810888,292.836708 L181.16913,292.836708 L181.16913,538 L82.3409742,538 Z\"\n fill=\"#1877F2\"\n ></path>\n </svg>\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInFacebookText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeGoogle\"\n [provider]=\"FederatedProviders.Google\"\n >\n <svg\n aria-label=\"Google icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 256 262\"\n xmlns=\"http://www.w3.org/2000/svg\"\n preserveAspectRatio=\"xMidYMid\"\n >\n <path\n d=\"M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622 38.755 30.023 2.685.268c24.659-22.774 38.875-56.282 38.875-96.027\"\n fill=\"#4285F4\"\n ></path>\n <path\n d=\"M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055-34.523 0-63.824-22.773-74.269-54.25l-1.531.13-40.298 31.187-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1\"\n fill=\"#34A853\"\n ></path>\n <path\n d=\"M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82 0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602l42.356-32.782\"\n fill=\"#FBBC05\"\n ></path>\n <path\n d=\"M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251\"\n fill=\"#EB4335\"\n ></path>\n </svg>\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInGoogleText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <hr\n class=\"amplify-divider amplify-divider--label amplify-divider--small\"\n aria-orientation=\"horizontal\"\n data-size=\"small\"\n data-label=\"
|
|
915
|
+
FederatedSignInComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FederatedSignInComponent, selector: "amplify-federated-sign-in", ngImport: i0__namespace, template: "<div\n class=\"amplify-flex federated-sign-in-container\"\n *ngIf=\"shouldShowFederatedSignIn\"\n data-orientation=\"horizontal\"\n data-size=\"small\"\n>\n <amplify-federated-sign-in-button\n *ngIf=\"includeAmazon\"\n [text]=\"signInAmazonText\"\n [provider]=\"FederatedProviders.Amazon\"\n >\n <svg\n aria-label=\"Amazon icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 248 268\"\n >\n <path\n d=\"M139.056521,147.024612 C133.548808,156.744524 124.782731,162.726926 115.087401,162.726926 C101.790721,162.726926 93.9937779,152.612964 93.9937779,137.68681 C93.9937779,108.224571 120.447551,102.879017 145.533369,102.879017 L145.533369,110.365976 C145.533369,123.831358 145.876354,135.063787 139.056521,147.024612 M207.206992,162.579655 C209.400505,165.692256 209.887066,169.437725 207.063416,171.770186 C199.996315,177.653081 187.429476,188.590967 180.513926,194.716661 L180.46208,194.621133 C178.176838,196.663031 174.862638,196.810303 172.27828,195.445057 C160.780281,185.9162 158.686473,181.494078 152.405048,172.403055 C133.405233,191.751331 119.909143,197.534719 95.309886,197.534719 C66.1281801,197.534719 43.4791563,179.599451 43.4791563,143.669212 C43.4791563,115.616003 58.6782107,96.5105248 80.4019706,87.1727225 C99.2063636,78.9096034 125.464714,77.4528107 145.533369,75.1641337 L145.533369,70.694248 C145.533369,62.4749122 146.167493,52.7510201 141.297893,45.6541312 C137.110277,39.2856386 129.018206,36.6586354 121.859376,36.6586354 C108.658413,36.6586354 96.9171331,43.4171982 94.0416364,57.4199213 C93.4593582,60.532522 91.1701278,63.5933787 88.003492,63.7406501 L54.4387473,60.1424518 C51.6150972,59.5095829 48.4484614,57.2248862 49.2740201,52.8982915 C56.9712583,12.2553679 93.7983558,0 126.732964,0 C143.587124,0 165.606011,4.47386604 178.902691,17.2148315 C195.760839,32.917146 194.149604,53.8694866 194.149604,76.6726704 L194.149604,130.542157 C194.149604,146.734049 200.87372,153.830938 207.206992,162.579655 Z M233.826346,208.038962 C230.467669,203.683255 211.550709,205.9821 203.056405,206.998432 C200.470662,207.321077 200.076227,205.042397 202.406981,203.404973 C217.475208,192.664928 242.201125,195.766353 245.081698,199.363845 C247.966255,202.981502 244.336653,228.071183 230.172839,240.049379 C228.001452,241.888455 225.929671,240.904388 226.89783,238.468418 C230.077218,230.430525 237.204944,212.418868 233.826346,208.038962 Z M126.768855,264 C74.0234043,264 42.0764048,241.955028 17.7852554,217.541992 C12.9733903,212.705982 6.71799208,206.295994 3.31151296,200.690918 C1.90227474,198.372135 5.59096074,195.021875 8.0442063,196.84375 C38.2390146,219.267578 82.1011654,239.538304 125.529506,239.538304 C154.819967,239.538304 191.046475,227.469543 220.66851,214.867659 C225.146771,212.966167 225.146771,219.180222 224.511585,221.060516 C224.183264,222.03242 209.514625,236.221149 189.247207,247.047411 C170.304273,257.166172 146.397132,264 126.768855,264 Z\"\n fill=\"#FF9900\"\n ></path>\n </svg>\n\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInAmazonText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeApple\"\n [provider]=\"FederatedProviders.Apple\"\n >\n <svg\n aria-label=\"Apple icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n fill=\"#000\"\n preserveAspectRatio=\"xMidYMid\"\n stroke=\"#000\"\n strokeWidth=\"0\"\n viewBox=\"0 0 1024 1024\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M747.4 535.7c-.4-68.2 30.5-119.6 92.9-157.5-34.9-50-87.7-77.5-157.3-82.8-65.9-5.2-138 38.4-164.4 38.4-27.9 0-91.7-36.6-141.9-36.6C273.1 298.8 163 379.8 163 544.6c0 48.7 8.9 99 26.7 150.8 23.8 68.2 109.6 235.3 199.1 232.6 46.8-1.1 79.9-33.2 140.8-33.2 59.1 0 89.7 33.2 141.9 33.2 90.3-1.3 167.9-153.2 190.5-221.6-121.1-57.1-114.6-167.2-114.6-170.7zm-105.1-305c50.7-60.2 46.1-115 44.6-134.7-44.8 2.6-96.6 30.5-126.1 64.8-32.5 36.8-51.6 82.3-47.5 133.6 48.4 3.7 92.6-21.2 129-63.7z\"\n ></path>\n </svg>\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInAppleText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeFacebook\"\n [text]=\"signInFacebookText\"\n [provider]=\"FederatedProviders.Facebook\"\n >\n <svg\n aria-label=\"Facebook icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 279 538\"\n >\n <path\n d=\"M82.3409742,538 L82.3409742,292.936652 L0,292.936652 L0,196.990154 L82.2410458,196.990154 L82.2410458,126.4295 C82.2410458,44.575144 132.205229,0 205.252865,0 C240.227794,0 270.306232,2.59855099 279,3.79788222 L279,89.2502322 L228.536175,89.2502322 C188.964542,89.2502322 181.270057,108.139699 181.270057,135.824262 L181.270057,196.89021 L276.202006,196.89021 L263.810888,292.836708 L181.16913,292.836708 L181.16913,538 L82.3409742,538 Z\"\n fill=\"#1877F2\"\n ></path>\n </svg>\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInFacebookText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeGoogle\"\n [provider]=\"FederatedProviders.Google\"\n >\n <svg\n aria-label=\"Google icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 256 262\"\n xmlns=\"http://www.w3.org/2000/svg\"\n preserveAspectRatio=\"xMidYMid\"\n >\n <path\n d=\"M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622 38.755 30.023 2.685.268c24.659-22.774 38.875-56.282 38.875-96.027\"\n fill=\"#4285F4\"\n ></path>\n <path\n d=\"M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055-34.523 0-63.824-22.773-74.269-54.25l-1.531.13-40.298 31.187-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1\"\n fill=\"#34A853\"\n ></path>\n <path\n d=\"M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82 0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602l42.356-32.782\"\n fill=\"#FBBC05\"\n ></path>\n <path\n d=\"M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251\"\n fill=\"#EB4335\"\n ></path>\n </svg>\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInGoogleText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <hr\n class=\"amplify-divider amplify-divider--label amplify-divider--small\"\n aria-orientation=\"horizontal\"\n data-size=\"small\"\n [attr.data-label]=\"orText\"\n />\n</div>\n", components: [{ type: FederatedSignInButtonComponent, selector: "amplify-federated-sign-in-button", inputs: ["provider", "text"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
907
916
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FederatedSignInComponent, decorators: [{
|
|
908
917
|
type: i0.Component,
|
|
909
918
|
args: [{
|
|
@@ -1422,7 +1431,7 @@
|
|
|
1422
1431
|
this.dataAttr = '';
|
|
1423
1432
|
this.headerText = getSetupTOTPText();
|
|
1424
1433
|
this.qrCodeSource = '';
|
|
1425
|
-
this.
|
|
1434
|
+
this.totpSecretCode = '';
|
|
1426
1435
|
this.copyTextLabel = getCopyText();
|
|
1427
1436
|
// translated texts
|
|
1428
1437
|
this.backToSignInText = getBackToSignInText$3();
|
|
@@ -1450,33 +1459,29 @@
|
|
|
1450
1459
|
SetupTotpComponent.prototype.generateQRCode = function () {
|
|
1451
1460
|
var _a, _b;
|
|
1452
1461
|
return __awaiter(this, void 0, void 0, function () {
|
|
1453
|
-
var state,
|
|
1462
|
+
var _c, state, totpSecretCode, user, formFields, _d, _e, totpIssuer, _f, totpUsername, totpCode, _g, err_1;
|
|
1454
1463
|
return __generator(this, function (_h) {
|
|
1455
1464
|
switch (_h.label) {
|
|
1456
1465
|
case 0:
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1466
|
+
_c = this.authenticator, state = _c.authState, totpSecretCode = _c.totpSecretCode, user = _c.user;
|
|
1467
|
+
formFields = ui.getActorContext(state).formFields;
|
|
1468
|
+
_d = (_b = (_a = formFields === null || formFields === void 0 ? void 0 : formFields.setupTOTP) === null || _a === void 0 ? void 0 : _a.QR) !== null && _b !== void 0 ? _b : {}, _e = _d.totpIssuer, totpIssuer = _e === void 0 ? 'AWSCognito' : _e, _f = _d.totpUsername, totpUsername = _f === void 0 ? user === null || user === void 0 ? void 0 : user.username : _f;
|
|
1469
|
+
this.totpSecretCode = totpSecretCode;
|
|
1461
1470
|
_h.label = 1;
|
|
1462
1471
|
case 1:
|
|
1463
|
-
_h.trys.push([1,
|
|
1464
|
-
|
|
1465
|
-
return [4 /*yield*/, awsAmplify.Auth.setupTOTP(user)];
|
|
1466
|
-
case 2:
|
|
1467
|
-
_f.secretKey = _h.sent();
|
|
1468
|
-
totpCode = ui.getTotpCodeURL(totpIssuer, totpUsername, this.secretKey);
|
|
1472
|
+
_h.trys.push([1, 3, , 4]);
|
|
1473
|
+
totpCode = ui.getTotpCodeURL(totpIssuer, totpUsername, this.totpSecretCode);
|
|
1469
1474
|
logger.info('totp code was generated:', totpCode);
|
|
1470
1475
|
_g = this;
|
|
1471
1476
|
return [4 /*yield*/, QRCode__default["default"].toDataURL(totpCode)];
|
|
1472
|
-
case
|
|
1477
|
+
case 2:
|
|
1473
1478
|
_g.qrCodeSource = _h.sent();
|
|
1474
|
-
return [3 /*break*/,
|
|
1475
|
-
case
|
|
1479
|
+
return [3 /*break*/, 4];
|
|
1480
|
+
case 3:
|
|
1476
1481
|
err_1 = _h.sent();
|
|
1477
1482
|
logger.error(err_1);
|
|
1478
|
-
return [3 /*break*/,
|
|
1479
|
-
case
|
|
1483
|
+
return [3 /*break*/, 4];
|
|
1484
|
+
case 4: return [2 /*return*/];
|
|
1480
1485
|
}
|
|
1481
1486
|
});
|
|
1482
1487
|
});
|
|
@@ -1491,13 +1496,13 @@
|
|
|
1491
1496
|
this.authenticator.submitForm(ui.getFormDataFromEvent(event));
|
|
1492
1497
|
};
|
|
1493
1498
|
SetupTotpComponent.prototype.copyText = function () {
|
|
1494
|
-
navigator.clipboard.writeText(this.
|
|
1499
|
+
navigator.clipboard.writeText(this.totpSecretCode);
|
|
1495
1500
|
this.copyTextLabel = getCopiedText();
|
|
1496
1501
|
};
|
|
1497
1502
|
return SetupTotpComponent;
|
|
1498
1503
|
}());
|
|
1499
1504
|
SetupTotpComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SetupTotpComponent, deps: [{ token: AuthenticatorService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1500
|
-
SetupTotpComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SetupTotpComponent, selector: "amplify-setup-totp", host: { properties: { "attr.data-amplify-authenticator-setup-totp": "this.dataAttr" } }, ngImport: i0__namespace, template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"setup-totp-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n <p *ngIf=\"!qrCodeSource\">Loading...</p>\n <img\n *ngIf=\"qrCodeSource\"\n [src]=\"qrCodeSource\"\n alt=\"qr code\"\n data-amplify-qrcode\n width=\"228\"\n height=\"228\"\n />\n <div class=\"amplify-flex\" data-amplify-copy>\n <div>{{
|
|
1505
|
+
SetupTotpComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SetupTotpComponent, selector: "amplify-setup-totp", host: { properties: { "attr.data-amplify-authenticator-setup-totp": "this.dataAttr" } }, ngImport: i0__namespace, template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"setup-totp-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n <p *ngIf=\"!qrCodeSource\">Loading...</p>\n <img\n *ngIf=\"qrCodeSource\"\n [src]=\"qrCodeSource\"\n alt=\"qr code\"\n data-amplify-qrcode\n width=\"228\"\n height=\"228\"\n />\n <div class=\"amplify-flex\" data-amplify-copy>\n <div>{{ totpSecretCode }}</div>\n <div data-amplify-copy-svg (click)=\"copyText()\">\n <div data-amplify-copy-tooltip>{{ copyTextLabel }}</div>\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM15 5H8C6.9 5 6.01 5.9 6.01 7L6 21C6 22.1 6.89 23 7.99 23H19C20.1 23 21 22.1 21 21V11L15 5ZM8 21V7H14V12H19V21H8Z\"\n />\n </svg>\n </div>\n </div>\n\n <amplify-base-form-fields route=\"setupTOTP\"></amplify-base-form-fields>\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ confirmText }}\n </button>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"setup-totp-footer\" [context]=\"context\"> </amplify-slot>\n</form>\n", components: [{ type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }, { type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { type: ErrorComponent, selector: "amplify-error" }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
1501
1506
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SetupTotpComponent, decorators: [{
|
|
1502
1507
|
type: i0.Component,
|
|
1503
1508
|
args: [{
|