@reachfive/identity-ui 1.22.0 → 1.23.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/CHANGELOG.md CHANGED
@@ -7,6 +7,17 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.23.1] - 2023-12-12
11
+
12
+ ### Fixes
13
+
14
+ - Handle provider variants correctly in showSocialAccount.
15
+
16
+ ## [1.23.0] - 2023-11-27
17
+
18
+ ## Added
19
+ - Improved mfa step up UX when only one second factor exists
20
+
10
21
  ## [1.22.0] - 2023-11-09
11
22
 
12
23
  ### Added
@@ -375,7 +386,11 @@ The eye icon is now correctly displayed in the Auth widget.
375
386
 
376
387
  First version of the SDK Web UI.
377
388
 
378
- [Unreleased]: https://github.com/ReachFive/identity-web-ui-sdk/compare/v1.22.0...HEAD
389
+ [Unreleased]: https://github.com/ReachFive/identity-web-ui-sdk/compare/v1.23.1...HEAD
390
+
391
+ [1.23.1]: https://github.com/ReachFive/identity-web-ui-sdk/compare/v1.23.0...v1.23.1
392
+
393
+ [1.23.0]: https://github.com/ReachFive/identity-web-ui-sdk/compare/v1.22.0...v1.23.0
379
394
 
380
395
  [1.22.0]: https://github.com/ReachFive/identity-web-ui-sdk/compare/v1.21.0...v1.22.0
381
396
 
@@ -8402,6 +8402,9 @@ var Check = withTheme(styled__default(function (_ref4) {
8402
8402
  checked: checked,
8403
8403
  name: name,
8404
8404
  onChange: onSelect,
8405
+ style: radio && {
8406
+ appearance: "radio"
8407
+ },
8405
8408
  required: required,
8406
8409
  value: value
8407
8410
  }), label);
@@ -11116,66 +11119,89 @@ var StartPasswordlessForm = createForm({
11116
11119
  })];
11117
11120
  }
11118
11121
  });
11119
- var MfaStepUpView = /*#__PURE__*/function (_React$Component) {
11120
- _inherits(MfaStepUpView, _React$Component);
11121
- var _super = _createSuper(MfaStepUpView);
11122
- function MfaStepUpView() {
11122
+ var MainView = /*#__PURE__*/function (_React$Component) {
11123
+ _inherits(MainView, _React$Component);
11124
+ var _super = _createSuper(MainView);
11125
+ function MainView(props) {
11123
11126
  var _this;
11124
- _classCallCheck(this, MfaStepUpView);
11125
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
11126
- args[_key] = arguments[_key];
11127
- }
11128
- _this = _super.call.apply(_super, [this].concat(args));
11127
+ _classCallCheck(this, MainView);
11128
+ _this = _super.call(this, props);
11129
11129
  _defineProperty(_assertThisInitialized(_this), "onGetStepUpToken", function () {
11130
11130
  return _this.props.apiClient.getMfaStepUpToken({
11131
11131
  options: _this.props.auth,
11132
11132
  accessToken: _this.props.accessToken
11133
+ }).then(function (res) {
11134
+ return _this.setState({
11135
+ response: res
11136
+ });
11133
11137
  });
11134
11138
  });
11139
+ _this.state = {
11140
+ response: undefined
11141
+ };
11135
11142
  return _this;
11136
11143
  }
11137
- _createClass(MfaStepUpView, [{
11144
+ _createClass(MainView, [{
11145
+ key: "componentDidMount",
11146
+ value: function componentDidMount() {
11147
+ this.onGetStepUpToken();
11148
+ }
11149
+ }, {
11138
11150
  key: "render",
11139
11151
  value: function render() {
11140
11152
  var _this2 = this;
11141
- return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(StartStepUpMfaButton, {
11153
+ var _this$props = this.props,
11154
+ showStepUpStart = _this$props.showStepUpStart,
11155
+ goTo = _this$props.goTo;
11156
+ return this.state.response === undefined ? null : /*#__PURE__*/React__default.createElement("div", null, showStepUpStart ? /*#__PURE__*/React__default.createElement(StartStepUpMfaButton, {
11142
11157
  handler: this.onGetStepUpToken,
11143
- onSuccess: function onSuccess(data) {
11144
- return _this2.props.goTo('fa-selection', _objectSpread2({}, data));
11158
+ onSuccess: function onSuccess(_) {
11159
+ return goTo('fa-selection', _this2.state.response);
11145
11160
  }
11146
- }));
11161
+ }) : /*#__PURE__*/React__default.createElement(FaSelectionView, _extends({}, this.state.response, this.props)));
11147
11162
  }
11148
11163
  }]);
11149
- return MfaStepUpView;
11164
+ return MainView;
11150
11165
  }(React__default.Component);
11151
11166
  var FaSelectionView = /*#__PURE__*/function (_React$Component2) {
11152
11167
  _inherits(FaSelectionView, _React$Component2);
11153
11168
  var _super2 = _createSuper(FaSelectionView);
11154
- function FaSelectionView() {
11169
+ function FaSelectionView(props) {
11155
11170
  var _this3;
11156
11171
  _classCallCheck(this, FaSelectionView);
11157
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
11158
- args[_key2] = arguments[_key2];
11159
- }
11160
- _this3 = _super2.call.apply(_super2, [this].concat(args));
11172
+ _this3 = _super2.call(this, props);
11161
11173
  _defineProperty(_assertThisInitialized(_this3), "onChooseFa", function (factor) {
11162
11174
  return _this3.props.apiClient.startPasswordless(_objectSpread2(_objectSpread2({}, factor), {}, {
11163
11175
  stepUp: _this3.props.token
11164
- })).then(function (resp) {
11165
- return _objectSpread2(_objectSpread2({}, resp), factor);
11176
+ })).then(function (res) {
11177
+ return _this3.setState({
11178
+ response: _objectSpread2(_objectSpread2({}, res), factor)
11179
+ });
11166
11180
  });
11167
11181
  });
11182
+ _this3.state = {
11183
+ response: undefined
11184
+ };
11168
11185
  return _this3;
11169
11186
  }
11170
11187
  _createClass(FaSelectionView, [{
11188
+ key: "componentDidMount",
11189
+ value: function componentDidMount() {
11190
+ if (this.props.amr.length == 1) this.onChooseFa({
11191
+ authType: this.props.amr[0]
11192
+ });else this.setState({
11193
+ response: {}
11194
+ });
11195
+ }
11196
+ }, {
11171
11197
  key: "render",
11172
11198
  value: function render() {
11173
11199
  var _this4 = this;
11174
- var _this$props = this.props,
11175
- amr = _this$props.amr,
11176
- showIntro = _this$props.showIntro,
11177
- i18n = _this$props.i18n;
11178
- return /*#__PURE__*/React__default.createElement("div", null, showIntro && /*#__PURE__*/React__default.createElement(Intro, null, i18n('mfa.select.factor')), /*#__PURE__*/React__default.createElement(StartPasswordlessForm, {
11200
+ var _this$props2 = this.props,
11201
+ amr = _this$props2.amr,
11202
+ showIntro = _this$props2.showIntro,
11203
+ i18n = _this$props2.i18n;
11204
+ return this.state.response === undefined ? null : amr.length == 1 ? /*#__PURE__*/React__default.createElement(VerificationCodeView, _extends({}, this.state.response, this.props)) : /*#__PURE__*/React__default.createElement("div", null, showIntro && /*#__PURE__*/React__default.createElement(Intro, null, i18n('mfa.select.factor')), /*#__PURE__*/React__default.createElement(StartPasswordlessForm, {
11179
11205
  options: amr.map(function (factor) {
11180
11206
  return {
11181
11207
  key: factor,
@@ -11187,7 +11213,7 @@ var FaSelectionView = /*#__PURE__*/function (_React$Component2) {
11187
11213
  onSuccess: function onSuccess(data) {
11188
11214
  return _this4.props.goTo('verification-code', _objectSpread2(_objectSpread2({}, data), {}, {
11189
11215
  amr: amr
11190
- }));
11216
+ }, _this4.state.response));
11191
11217
  }
11192
11218
  }));
11193
11219
  }
@@ -11200,8 +11226,8 @@ var VerificationCodeView = /*#__PURE__*/function (_React$Component3) {
11200
11226
  function VerificationCodeView() {
11201
11227
  var _this5;
11202
11228
  _classCallCheck(this, VerificationCodeView);
11203
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
11204
- args[_key3] = arguments[_key3];
11229
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
11230
+ args[_key] = arguments[_key];
11205
11231
  }
11206
11232
  _this5 = _super3.call.apply(_super3, [this].concat(args));
11207
11233
  _defineProperty(_assertThisInitialized(_this5), "handleSubmit", function (data) {
@@ -11229,15 +11255,16 @@ var VerificationCodeView = /*#__PURE__*/function (_React$Component3) {
11229
11255
  return VerificationCodeView;
11230
11256
  }(React__default.Component);
11231
11257
  var mfaStepUpWidget = createMultiViewWidget({
11232
- initialView: 'mfa-step-up',
11258
+ initialView: 'main',
11233
11259
  views: {
11234
- 'mfa-step-up': MfaStepUpView,
11260
+ 'main': MainView,
11235
11261
  'fa-selection': FaSelectionView,
11236
11262
  'verification-code': VerificationCodeView
11237
11263
  },
11238
11264
  prepare: function prepare(options) {
11239
11265
  return deepDefaults({}, options, {
11240
- showIntro: true
11266
+ showIntro: true,
11267
+ showStepUpStart: true
11241
11268
  });
11242
11269
  }
11243
11270
  });
@@ -11301,7 +11328,7 @@ var EmailEditorForm = createForm({
11301
11328
  validator: email
11302
11329
  })]
11303
11330
  });
11304
- var MainView = /*#__PURE__*/function (_React$Component) {
11331
+ var MainView$1 = /*#__PURE__*/function (_React$Component) {
11305
11332
  _inherits(MainView, _React$Component);
11306
11333
  var _super = _createSuper(MainView);
11307
11334
  function MainView() {
@@ -11353,7 +11380,7 @@ var SuccessView = function SuccessView(_ref) {
11353
11380
  var emailEditorWidget = createMultiViewWidget({
11354
11381
  initialView: 'main',
11355
11382
  views: {
11356
- main: MainView,
11383
+ main: MainView$1,
11357
11384
  success: SuccessView
11358
11385
  }
11359
11386
  });
@@ -11490,7 +11517,7 @@ var VerificationCodeInputForm$1 = createForm({
11490
11517
  type: 'text'
11491
11518
  })]
11492
11519
  });
11493
- var MainView$1 = /*#__PURE__*/function (_React$Component) {
11520
+ var MainView$2 = /*#__PURE__*/function (_React$Component) {
11494
11521
  _inherits(MainView, _React$Component);
11495
11522
  var _super = _createSuper(MainView);
11496
11523
  function MainView() {
@@ -11572,12 +11599,12 @@ _defineProperty(VerificationCodeView$1, "defaultProps", {
11572
11599
  var phoneNumberEditorWidget = createMultiViewWidget({
11573
11600
  initialView: 'main',
11574
11601
  views: {
11575
- main: MainView$1,
11602
+ main: MainView$2,
11576
11603
  verificationCode: VerificationCodeView$1
11577
11604
  }
11578
11605
  });
11579
11606
 
11580
- var MainView$2 = /*#__PURE__*/function (_React$Component) {
11607
+ var MainView$3 = /*#__PURE__*/function (_React$Component) {
11581
11608
  _inherits(MainView, _React$Component);
11582
11609
  var _super = _createSuper(MainView);
11583
11610
  function MainView() {
@@ -11611,7 +11638,7 @@ var MainView$2 = /*#__PURE__*/function (_React$Component) {
11611
11638
  }]);
11612
11639
  return MainView;
11613
11640
  }(React__default.Component);
11614
- _defineProperty(MainView$2, "defaultProps", {
11641
+ _defineProperty(MainView$3, "defaultProps", {
11615
11642
  onSuccess: function onSuccess() {},
11616
11643
  onError: function onError() {}
11617
11644
  });
@@ -11631,7 +11658,7 @@ var resolveCode = function resolveCode() {
11631
11658
  var passwordResetWidget = createMultiViewWidget({
11632
11659
  initialView: 'main',
11633
11660
  views: {
11634
- main: MainView$2,
11661
+ main: MainView$3,
11635
11662
  success: SuccessView$1
11636
11663
  },
11637
11664
  prepare: function prepare(options) {
@@ -11664,7 +11691,7 @@ var VerificationCodeInputForm$2 = createForm({
11664
11691
  type: 'text'
11665
11692
  })]
11666
11693
  });
11667
- var MainView$3 = /*#__PURE__*/function (_React$Component) {
11694
+ var MainView$4 = /*#__PURE__*/function (_React$Component) {
11668
11695
  _inherits(MainView, _React$Component);
11669
11696
  var _super = _createSuper(MainView);
11670
11697
  function MainView() {
@@ -11762,7 +11789,7 @@ var EmailSentView = function EmailSentView(_ref) {
11762
11789
  var passwordlessWidget = createMultiViewWidget({
11763
11790
  initialView: 'main',
11764
11791
  views: {
11765
- main: MainView$3,
11792
+ main: MainView$4,
11766
11793
  emailSent: EmailSentView,
11767
11794
  verificationCode: VerificationCodeView$2
11768
11795
  },
@@ -12100,7 +12127,10 @@ var socialAccountsWidget = createMultiViewWidget({
12100
12127
  providers: config.socialProviders
12101
12128
  }, options), {}, {
12102
12129
  getAvailableProviders: function getAvailableProviders(identities) {
12103
- return difference(options.providers || config.socialProviders, identities.map(function (i) {
12130
+ var providerNames = (options.providers || config.socialProviders).map(function (provider) {
12131
+ return provider.split(':').shift();
12132
+ });
12133
+ return difference(providerNames, identities.map(function (i) {
12104
12134
  return i.provider;
12105
12135
  }));
12106
12136
  }
@@ -12297,7 +12327,7 @@ var PhoneNumberRegisteringCredentialForm = function PhoneNumberRegisteringCreden
12297
12327
  var DivCredentialBlock = withTheme(styled__default.div(_templateObject$h || (_templateObject$h = _taggedTemplateLiteral(["\n margin-left: ", "px;\n margin-bottom: 5em;\n"])), function (props) {
12298
12328
  return props.theme.get('_blockInnerHeight');
12299
12329
  }));
12300
- var MainView$4 = /*#__PURE__*/function (_React$Component) {
12330
+ var MainView$5 = /*#__PURE__*/function (_React$Component) {
12301
12331
  _inherits(MainView, _React$Component);
12302
12332
  var _super = _createSuper(MainView);
12303
12333
  function MainView() {
@@ -12339,7 +12369,8 @@ var MainView$4 = /*#__PURE__*/function (_React$Component) {
12339
12369
  showIntro = _this$props.showIntro,
12340
12370
  config = _this$props.config,
12341
12371
  showRemoveMfaCredentials = _this$props.showRemoveMfaCredentials,
12342
- credentials = _this$props.credentials;
12372
+ credentials = _this$props.credentials,
12373
+ requireMfaRegistration = _this$props.requireMfaRegistration;
12343
12374
  var PhoneNumberInputForm = PhoneNumberRegisteringCredentialForm(config);
12344
12375
  var phoneNumberCredentialRegistered = credentials.find(function (credential) {
12345
12376
  return credential.type === 'sms';
@@ -12347,7 +12378,9 @@ var MainView$4 = /*#__PURE__*/function (_React$Component) {
12347
12378
  var isEmailCredentialRegistered = credentials.some(function (credential) {
12348
12379
  return credential.type === 'email';
12349
12380
  });
12350
- return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(DivCredentialBlock, null, config.mfaEmailEnabled && /*#__PURE__*/React__default.createElement("div", null, showIntro && /*#__PURE__*/React__default.createElement(Intro, null, i18n('mfa.email.explain')), /*#__PURE__*/React__default.createElement(EmailRegisteringCredentialForm, {
12381
+ return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(DivCredentialBlock, null, config.mfaEmailEnabled && !credentials.map(function (credential) {
12382
+ return credential.type;
12383
+ }).includes('email') && /*#__PURE__*/React__default.createElement("div", null, showIntro && /*#__PURE__*/React__default.createElement(Intro, null, requireMfaRegistration ? i18n('mfa.email.explain.required') : i18n('mfa.email.explain')), /*#__PURE__*/React__default.createElement(EmailRegisteringCredentialForm, {
12351
12384
  handler: this.onEmailRegistering,
12352
12385
  onSuccess: function onSuccess(data) {
12353
12386
  return _this2.props.goTo('verification-code', _objectSpread2(_objectSpread2({}, data), {}, {
@@ -12448,7 +12481,7 @@ var CredentialRemovedView = function CredentialRemovedView(_ref2) {
12448
12481
  var mfaCredentialsWidget = createMultiViewWidget({
12449
12482
  initialView: 'main',
12450
12483
  views: {
12451
- 'main': MainView$4,
12484
+ 'main': MainView$5,
12452
12485
  'credential-registered': CredentialRegisteredView,
12453
12486
  'verification-code': VerificationCodeView$3,
12454
12487
  'credential-removed': CredentialRemovedView
@@ -12460,6 +12493,7 @@ var mfaCredentialsWidget = createMultiViewWidget({
12460
12493
  }).then(function (credentials) {
12461
12494
  return deepDefaults(_objectSpread2(_objectSpread2({
12462
12495
  showIntro: true,
12496
+ requireMfaRegistration: false,
12463
12497
  showRemoveMfaCredentials: true
12464
12498
  }, options), credentials));
12465
12499
  });
package/es/identity-ui.js CHANGED
@@ -8394,6 +8394,9 @@ var Check = withTheme(styled(function (_ref4) {
8394
8394
  checked: checked,
8395
8395
  name: name,
8396
8396
  onChange: onSelect,
8397
+ style: radio && {
8398
+ appearance: "radio"
8399
+ },
8397
8400
  required: required,
8398
8401
  value: value
8399
8402
  }), label);
@@ -11108,66 +11111,89 @@ var StartPasswordlessForm = createForm({
11108
11111
  })];
11109
11112
  }
11110
11113
  });
11111
- var MfaStepUpView = /*#__PURE__*/function (_React$Component) {
11112
- _inherits(MfaStepUpView, _React$Component);
11113
- var _super = _createSuper(MfaStepUpView);
11114
- function MfaStepUpView() {
11114
+ var MainView = /*#__PURE__*/function (_React$Component) {
11115
+ _inherits(MainView, _React$Component);
11116
+ var _super = _createSuper(MainView);
11117
+ function MainView(props) {
11115
11118
  var _this;
11116
- _classCallCheck(this, MfaStepUpView);
11117
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
11118
- args[_key] = arguments[_key];
11119
- }
11120
- _this = _super.call.apply(_super, [this].concat(args));
11119
+ _classCallCheck(this, MainView);
11120
+ _this = _super.call(this, props);
11121
11121
  _defineProperty(_assertThisInitialized(_this), "onGetStepUpToken", function () {
11122
11122
  return _this.props.apiClient.getMfaStepUpToken({
11123
11123
  options: _this.props.auth,
11124
11124
  accessToken: _this.props.accessToken
11125
+ }).then(function (res) {
11126
+ return _this.setState({
11127
+ response: res
11128
+ });
11125
11129
  });
11126
11130
  });
11131
+ _this.state = {
11132
+ response: undefined
11133
+ };
11127
11134
  return _this;
11128
11135
  }
11129
- _createClass(MfaStepUpView, [{
11136
+ _createClass(MainView, [{
11137
+ key: "componentDidMount",
11138
+ value: function componentDidMount() {
11139
+ this.onGetStepUpToken();
11140
+ }
11141
+ }, {
11130
11142
  key: "render",
11131
11143
  value: function render() {
11132
11144
  var _this2 = this;
11133
- return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(StartStepUpMfaButton, {
11145
+ var _this$props = this.props,
11146
+ showStepUpStart = _this$props.showStepUpStart,
11147
+ goTo = _this$props.goTo;
11148
+ return this.state.response === undefined ? null : /*#__PURE__*/React__default.createElement("div", null, showStepUpStart ? /*#__PURE__*/React__default.createElement(StartStepUpMfaButton, {
11134
11149
  handler: this.onGetStepUpToken,
11135
- onSuccess: function onSuccess(data) {
11136
- return _this2.props.goTo('fa-selection', _objectSpread2({}, data));
11150
+ onSuccess: function onSuccess(_) {
11151
+ return goTo('fa-selection', _this2.state.response);
11137
11152
  }
11138
- }));
11153
+ }) : /*#__PURE__*/React__default.createElement(FaSelectionView, _extends({}, this.state.response, this.props)));
11139
11154
  }
11140
11155
  }]);
11141
- return MfaStepUpView;
11156
+ return MainView;
11142
11157
  }(React__default.Component);
11143
11158
  var FaSelectionView = /*#__PURE__*/function (_React$Component2) {
11144
11159
  _inherits(FaSelectionView, _React$Component2);
11145
11160
  var _super2 = _createSuper(FaSelectionView);
11146
- function FaSelectionView() {
11161
+ function FaSelectionView(props) {
11147
11162
  var _this3;
11148
11163
  _classCallCheck(this, FaSelectionView);
11149
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
11150
- args[_key2] = arguments[_key2];
11151
- }
11152
- _this3 = _super2.call.apply(_super2, [this].concat(args));
11164
+ _this3 = _super2.call(this, props);
11153
11165
  _defineProperty(_assertThisInitialized(_this3), "onChooseFa", function (factor) {
11154
11166
  return _this3.props.apiClient.startPasswordless(_objectSpread2(_objectSpread2({}, factor), {}, {
11155
11167
  stepUp: _this3.props.token
11156
- })).then(function (resp) {
11157
- return _objectSpread2(_objectSpread2({}, resp), factor);
11168
+ })).then(function (res) {
11169
+ return _this3.setState({
11170
+ response: _objectSpread2(_objectSpread2({}, res), factor)
11171
+ });
11158
11172
  });
11159
11173
  });
11174
+ _this3.state = {
11175
+ response: undefined
11176
+ };
11160
11177
  return _this3;
11161
11178
  }
11162
11179
  _createClass(FaSelectionView, [{
11180
+ key: "componentDidMount",
11181
+ value: function componentDidMount() {
11182
+ if (this.props.amr.length == 1) this.onChooseFa({
11183
+ authType: this.props.amr[0]
11184
+ });else this.setState({
11185
+ response: {}
11186
+ });
11187
+ }
11188
+ }, {
11163
11189
  key: "render",
11164
11190
  value: function render() {
11165
11191
  var _this4 = this;
11166
- var _this$props = this.props,
11167
- amr = _this$props.amr,
11168
- showIntro = _this$props.showIntro,
11169
- i18n = _this$props.i18n;
11170
- return /*#__PURE__*/React__default.createElement("div", null, showIntro && /*#__PURE__*/React__default.createElement(Intro, null, i18n('mfa.select.factor')), /*#__PURE__*/React__default.createElement(StartPasswordlessForm, {
11192
+ var _this$props2 = this.props,
11193
+ amr = _this$props2.amr,
11194
+ showIntro = _this$props2.showIntro,
11195
+ i18n = _this$props2.i18n;
11196
+ return this.state.response === undefined ? null : amr.length == 1 ? /*#__PURE__*/React__default.createElement(VerificationCodeView, _extends({}, this.state.response, this.props)) : /*#__PURE__*/React__default.createElement("div", null, showIntro && /*#__PURE__*/React__default.createElement(Intro, null, i18n('mfa.select.factor')), /*#__PURE__*/React__default.createElement(StartPasswordlessForm, {
11171
11197
  options: amr.map(function (factor) {
11172
11198
  return {
11173
11199
  key: factor,
@@ -11179,7 +11205,7 @@ var FaSelectionView = /*#__PURE__*/function (_React$Component2) {
11179
11205
  onSuccess: function onSuccess(data) {
11180
11206
  return _this4.props.goTo('verification-code', _objectSpread2(_objectSpread2({}, data), {}, {
11181
11207
  amr: amr
11182
- }));
11208
+ }, _this4.state.response));
11183
11209
  }
11184
11210
  }));
11185
11211
  }
@@ -11192,8 +11218,8 @@ var VerificationCodeView = /*#__PURE__*/function (_React$Component3) {
11192
11218
  function VerificationCodeView() {
11193
11219
  var _this5;
11194
11220
  _classCallCheck(this, VerificationCodeView);
11195
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
11196
- args[_key3] = arguments[_key3];
11221
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
11222
+ args[_key] = arguments[_key];
11197
11223
  }
11198
11224
  _this5 = _super3.call.apply(_super3, [this].concat(args));
11199
11225
  _defineProperty(_assertThisInitialized(_this5), "handleSubmit", function (data) {
@@ -11221,15 +11247,16 @@ var VerificationCodeView = /*#__PURE__*/function (_React$Component3) {
11221
11247
  return VerificationCodeView;
11222
11248
  }(React__default.Component);
11223
11249
  var mfaStepUpWidget = createMultiViewWidget({
11224
- initialView: 'mfa-step-up',
11250
+ initialView: 'main',
11225
11251
  views: {
11226
- 'mfa-step-up': MfaStepUpView,
11252
+ 'main': MainView,
11227
11253
  'fa-selection': FaSelectionView,
11228
11254
  'verification-code': VerificationCodeView
11229
11255
  },
11230
11256
  prepare: function prepare(options) {
11231
11257
  return deepDefaults({}, options, {
11232
- showIntro: true
11258
+ showIntro: true,
11259
+ showStepUpStart: true
11233
11260
  });
11234
11261
  }
11235
11262
  });
@@ -11293,7 +11320,7 @@ var EmailEditorForm = createForm({
11293
11320
  validator: email
11294
11321
  })]
11295
11322
  });
11296
- var MainView = /*#__PURE__*/function (_React$Component) {
11323
+ var MainView$1 = /*#__PURE__*/function (_React$Component) {
11297
11324
  _inherits(MainView, _React$Component);
11298
11325
  var _super = _createSuper(MainView);
11299
11326
  function MainView() {
@@ -11345,7 +11372,7 @@ var SuccessView = function SuccessView(_ref) {
11345
11372
  var emailEditorWidget = createMultiViewWidget({
11346
11373
  initialView: 'main',
11347
11374
  views: {
11348
- main: MainView,
11375
+ main: MainView$1,
11349
11376
  success: SuccessView
11350
11377
  }
11351
11378
  });
@@ -11482,7 +11509,7 @@ var VerificationCodeInputForm$1 = createForm({
11482
11509
  type: 'text'
11483
11510
  })]
11484
11511
  });
11485
- var MainView$1 = /*#__PURE__*/function (_React$Component) {
11512
+ var MainView$2 = /*#__PURE__*/function (_React$Component) {
11486
11513
  _inherits(MainView, _React$Component);
11487
11514
  var _super = _createSuper(MainView);
11488
11515
  function MainView() {
@@ -11564,12 +11591,12 @@ _defineProperty(VerificationCodeView$1, "defaultProps", {
11564
11591
  var phoneNumberEditorWidget = createMultiViewWidget({
11565
11592
  initialView: 'main',
11566
11593
  views: {
11567
- main: MainView$1,
11594
+ main: MainView$2,
11568
11595
  verificationCode: VerificationCodeView$1
11569
11596
  }
11570
11597
  });
11571
11598
 
11572
- var MainView$2 = /*#__PURE__*/function (_React$Component) {
11599
+ var MainView$3 = /*#__PURE__*/function (_React$Component) {
11573
11600
  _inherits(MainView, _React$Component);
11574
11601
  var _super = _createSuper(MainView);
11575
11602
  function MainView() {
@@ -11603,7 +11630,7 @@ var MainView$2 = /*#__PURE__*/function (_React$Component) {
11603
11630
  }]);
11604
11631
  return MainView;
11605
11632
  }(React__default.Component);
11606
- _defineProperty(MainView$2, "defaultProps", {
11633
+ _defineProperty(MainView$3, "defaultProps", {
11607
11634
  onSuccess: function onSuccess() {},
11608
11635
  onError: function onError() {}
11609
11636
  });
@@ -11623,7 +11650,7 @@ var resolveCode = function resolveCode() {
11623
11650
  var passwordResetWidget = createMultiViewWidget({
11624
11651
  initialView: 'main',
11625
11652
  views: {
11626
- main: MainView$2,
11653
+ main: MainView$3,
11627
11654
  success: SuccessView$1
11628
11655
  },
11629
11656
  prepare: function prepare(options) {
@@ -11656,7 +11683,7 @@ var VerificationCodeInputForm$2 = createForm({
11656
11683
  type: 'text'
11657
11684
  })]
11658
11685
  });
11659
- var MainView$3 = /*#__PURE__*/function (_React$Component) {
11686
+ var MainView$4 = /*#__PURE__*/function (_React$Component) {
11660
11687
  _inherits(MainView, _React$Component);
11661
11688
  var _super = _createSuper(MainView);
11662
11689
  function MainView() {
@@ -11754,7 +11781,7 @@ var EmailSentView = function EmailSentView(_ref) {
11754
11781
  var passwordlessWidget = createMultiViewWidget({
11755
11782
  initialView: 'main',
11756
11783
  views: {
11757
- main: MainView$3,
11784
+ main: MainView$4,
11758
11785
  emailSent: EmailSentView,
11759
11786
  verificationCode: VerificationCodeView$2
11760
11787
  },
@@ -12092,7 +12119,10 @@ var socialAccountsWidget = createMultiViewWidget({
12092
12119
  providers: config.socialProviders
12093
12120
  }, options), {}, {
12094
12121
  getAvailableProviders: function getAvailableProviders(identities) {
12095
- return difference(options.providers || config.socialProviders, identities.map(function (i) {
12122
+ var providerNames = (options.providers || config.socialProviders).map(function (provider) {
12123
+ return provider.split(':').shift();
12124
+ });
12125
+ return difference(providerNames, identities.map(function (i) {
12096
12126
  return i.provider;
12097
12127
  }));
12098
12128
  }
@@ -12289,7 +12319,7 @@ var PhoneNumberRegisteringCredentialForm = function PhoneNumberRegisteringCreden
12289
12319
  var DivCredentialBlock = withTheme(styled.div(_templateObject$h || (_templateObject$h = _taggedTemplateLiteral(["\n margin-left: ", "px;\n margin-bottom: 5em;\n"])), function (props) {
12290
12320
  return props.theme.get('_blockInnerHeight');
12291
12321
  }));
12292
- var MainView$4 = /*#__PURE__*/function (_React$Component) {
12322
+ var MainView$5 = /*#__PURE__*/function (_React$Component) {
12293
12323
  _inherits(MainView, _React$Component);
12294
12324
  var _super = _createSuper(MainView);
12295
12325
  function MainView() {
@@ -12331,7 +12361,8 @@ var MainView$4 = /*#__PURE__*/function (_React$Component) {
12331
12361
  showIntro = _this$props.showIntro,
12332
12362
  config = _this$props.config,
12333
12363
  showRemoveMfaCredentials = _this$props.showRemoveMfaCredentials,
12334
- credentials = _this$props.credentials;
12364
+ credentials = _this$props.credentials,
12365
+ requireMfaRegistration = _this$props.requireMfaRegistration;
12335
12366
  var PhoneNumberInputForm = PhoneNumberRegisteringCredentialForm(config);
12336
12367
  var phoneNumberCredentialRegistered = credentials.find(function (credential) {
12337
12368
  return credential.type === 'sms';
@@ -12339,7 +12370,9 @@ var MainView$4 = /*#__PURE__*/function (_React$Component) {
12339
12370
  var isEmailCredentialRegistered = credentials.some(function (credential) {
12340
12371
  return credential.type === 'email';
12341
12372
  });
12342
- return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(DivCredentialBlock, null, config.mfaEmailEnabled && /*#__PURE__*/React__default.createElement("div", null, showIntro && /*#__PURE__*/React__default.createElement(Intro, null, i18n('mfa.email.explain')), /*#__PURE__*/React__default.createElement(EmailRegisteringCredentialForm, {
12373
+ return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(DivCredentialBlock, null, config.mfaEmailEnabled && !credentials.map(function (credential) {
12374
+ return credential.type;
12375
+ }).includes('email') && /*#__PURE__*/React__default.createElement("div", null, showIntro && /*#__PURE__*/React__default.createElement(Intro, null, requireMfaRegistration ? i18n('mfa.email.explain.required') : i18n('mfa.email.explain')), /*#__PURE__*/React__default.createElement(EmailRegisteringCredentialForm, {
12343
12376
  handler: this.onEmailRegistering,
12344
12377
  onSuccess: function onSuccess(data) {
12345
12378
  return _this2.props.goTo('verification-code', _objectSpread2(_objectSpread2({}, data), {}, {
@@ -12440,7 +12473,7 @@ var CredentialRemovedView = function CredentialRemovedView(_ref2) {
12440
12473
  var mfaCredentialsWidget = createMultiViewWidget({
12441
12474
  initialView: 'main',
12442
12475
  views: {
12443
- 'main': MainView$4,
12476
+ 'main': MainView$5,
12444
12477
  'credential-registered': CredentialRegisteredView,
12445
12478
  'verification-code': VerificationCodeView$3,
12446
12479
  'credential-removed': CredentialRemovedView
@@ -12452,6 +12485,7 @@ var mfaCredentialsWidget = createMultiViewWidget({
12452
12485
  }).then(function (credentials) {
12453
12486
  return deepDefaults(_objectSpread2(_objectSpread2({
12454
12487
  showIntro: true,
12488
+ requireMfaRegistration: false,
12455
12489
  showRemoveMfaCredentials: true
12456
12490
  }, options), credentials));
12457
12491
  });