@reachfive/identity-ui 1.14.0 → 1.15.0
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 +36 -17
- package/cjs/identity-ui.js +191 -34
- package/es/identity-ui.js +191 -34
- package/package.json +2 -2
- package/umd/identity-ui.js +194 -37
- package/umd/identity-ui.min.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,13 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.15.0] - 2022-02-22
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Add ReCaptcha V3 for authentication pages: forgot-password, signup, login-with-password
|
|
15
|
+
- Add ReCaptcha V3 for passwordless page
|
|
16
|
+
|
|
10
17
|
## [1.14.0] - 2021-11-10
|
|
11
18
|
|
|
12
19
|
### Changed
|
|
@@ -76,7 +83,7 @@ Temporary revert the SDK Core dependency version to solve the login with PKCE in
|
|
|
76
83
|
|
|
77
84
|
## [1.11.2] - 2020-11-04
|
|
78
85
|
|
|
79
|
-
###
|
|
86
|
+
### Added
|
|
80
87
|
|
|
81
88
|
A new check rule for password strength is now displayed on the signup view on
|
|
82
89
|
the [showAuth](https://developer.reachfive.com/sdk-ui/showAuth.html) widget.
|
|
@@ -89,7 +96,7 @@ Revert the new check rule for password strength since the wordings are not yet d
|
|
|
89
96
|
|
|
90
97
|
## [1.11.0] - 2020-10-28
|
|
91
98
|
|
|
92
|
-
###
|
|
99
|
+
### Added
|
|
93
100
|
|
|
94
101
|
New changes were made on the [showAuth](https://developer.reachfive.com/sdk-ui/showAuth.html) widget:
|
|
95
102
|
|
|
@@ -106,14 +113,14 @@ Revert the latest FIDO2 signup Features since it's breaking the style of Hosted
|
|
|
106
113
|
|
|
107
114
|
## [1.10.0] - 2020-10-16
|
|
108
115
|
|
|
109
|
-
###
|
|
116
|
+
### Added
|
|
110
117
|
|
|
111
118
|
The [showAuth](https://developer.reachfive.com/sdk-ui/showAuth.html) widget can now handle signup with biometrics if
|
|
112
119
|
the `allowWebAuthnSignup` option is enabled.
|
|
113
120
|
|
|
114
121
|
## [1.9.0] - 2020-09-16
|
|
115
122
|
|
|
116
|
-
###
|
|
123
|
+
### Added
|
|
117
124
|
|
|
118
125
|
Always override account `opt-out` consents.
|
|
119
126
|
|
|
@@ -123,13 +130,13 @@ Fixes the CircleCi job to deploy a new version.
|
|
|
123
130
|
|
|
124
131
|
## [1.8.0] - 2020-07-22
|
|
125
132
|
|
|
126
|
-
###
|
|
133
|
+
### Added
|
|
127
134
|
|
|
128
135
|
Add custom fields types (email & phone).
|
|
129
136
|
|
|
130
137
|
## [1.7.0] - 2020-07-08
|
|
131
138
|
|
|
132
|
-
###
|
|
139
|
+
### Added
|
|
133
140
|
|
|
134
141
|
- The user can now set the device's name in
|
|
135
142
|
the [showWebAuthnDevices](https://developer.reachfive.com/sdk-ui/showWebAuthnDevices.html) widget.
|
|
@@ -137,7 +144,7 @@ Add custom fields types (email & phone).
|
|
|
137
144
|
|
|
138
145
|
## [1.6.0] - 2020-07-07
|
|
139
146
|
|
|
140
|
-
###
|
|
147
|
+
### Added
|
|
141
148
|
|
|
142
149
|
Display a friendly user error message on
|
|
143
150
|
the [showWebAuthnDevices](https://developer.reachfive.com/sdk-ui/showWebAuthnDevices.html) widget when the user wants to
|
|
@@ -145,7 +152,7 @@ add a device already registered.
|
|
|
145
152
|
|
|
146
153
|
## [1.5.0] - 2020-07-01
|
|
147
154
|
|
|
148
|
-
###
|
|
155
|
+
### Added
|
|
149
156
|
|
|
150
157
|
Add a new widget [showWebAuthnDevices](https://developer.reachfive.com/sdk-ui/showWebAuthnDevices.html) allowing the
|
|
151
158
|
management of the user’s registered FIDO2 devices.
|
|
@@ -158,7 +165,7 @@ The UI SDK now uses the latest version of the Core SDK.
|
|
|
158
165
|
|
|
159
166
|
## [1.4.0] - 2020-06-15
|
|
160
167
|
|
|
161
|
-
###
|
|
168
|
+
### Added
|
|
162
169
|
|
|
163
170
|
Add a new `allowWebAuthnLogin` option to the [showAuth](https://developer.reachfive.com/sdk-ui/showAuth.html) widget to
|
|
164
171
|
allow a user to login with biometrics.
|
|
@@ -169,7 +176,7 @@ allow a user to login with biometrics.
|
|
|
169
176
|
|
|
170
177
|
Call only the validation methods when the field is required or when the value is not empty.
|
|
171
178
|
|
|
172
|
-
###
|
|
179
|
+
### Added
|
|
173
180
|
|
|
174
181
|
- Set the default value of the _Remember be_ to `false`.
|
|
175
182
|
- Upgrade all the dependencies.
|
|
@@ -200,13 +207,13 @@ ReachFive UI SDK is out! 🚀
|
|
|
200
207
|
|
|
201
208
|
## [1.0.0-alpha.10] - 2020-02-19
|
|
202
209
|
|
|
203
|
-
###
|
|
210
|
+
### Added
|
|
204
211
|
|
|
205
212
|
Improve the UX/UI of the password policy rules validation.
|
|
206
213
|
|
|
207
214
|
## [1.0.0-alpha.9] - 2020-02-10
|
|
208
215
|
|
|
209
|
-
###
|
|
216
|
+
### Added
|
|
210
217
|
|
|
211
218
|
The _display password in clear text_ option can now be enabled on the password reset widget.
|
|
212
219
|
|
|
@@ -218,7 +225,7 @@ The UI SDK uses now the latest version of the Core SDK.
|
|
|
218
225
|
|
|
219
226
|
## [1.0.0-alpha.7] - 2020-02-06
|
|
220
227
|
|
|
221
|
-
###
|
|
228
|
+
### Added
|
|
222
229
|
|
|
223
230
|
Add the `returnToAfterPasswordReset` parameter for reset password and the `returnToAfterEmailConfirmation` parameter for
|
|
224
231
|
signup.
|
|
@@ -237,14 +244,14 @@ Passwords in the French dictionary were considered good enough while they weren'
|
|
|
237
244
|
|
|
238
245
|
## [1.0.0-alpha.4] - 2020-01-15
|
|
239
246
|
|
|
240
|
-
###
|
|
247
|
+
### Added
|
|
241
248
|
|
|
242
249
|
- French weak passwords are now rejected by the password strength policies.
|
|
243
250
|
- A UMD bundle is now generated at the build process. It will allow deploying the UI SDK on [unpkg](https://unpkg.com).
|
|
244
251
|
|
|
245
252
|
## [1.0.0-alpha.3] - 2020-01-07
|
|
246
253
|
|
|
247
|
-
###
|
|
254
|
+
### Added
|
|
248
255
|
|
|
249
256
|
- Implement continuous integration pipelines set up with CircleCI (see
|
|
250
257
|
the [CircleCI configuration file](.circleci/config.yml) for more details).
|
|
@@ -256,7 +263,7 @@ The eye icon is now correctly displayed in the Auth widget.
|
|
|
256
263
|
|
|
257
264
|
## [1.0.0-alpha.2] - 2019-11-06
|
|
258
265
|
|
|
259
|
-
###
|
|
266
|
+
### Added
|
|
260
267
|
|
|
261
268
|
- A `data-testid` attribute was added to most of the HTML elements.
|
|
262
269
|
- Handle the errors returned at the creation of a password non-compliant to the account's password policy.
|
|
@@ -265,7 +272,19 @@ The eye icon is now correctly displayed in the Auth widget.
|
|
|
265
272
|
|
|
266
273
|
First version of the SDK Web UI.
|
|
267
274
|
|
|
268
|
-
[Unreleased]: https://github.com/ReachFive/identity-web-ui-sdk/compare/v1.
|
|
275
|
+
[Unreleased]: https://github.com/ReachFive/identity-web-ui-sdk/compare/v1.15.0...HEAD
|
|
276
|
+
|
|
277
|
+
[1.15.0]: https://github.com/ReachFive/identity-web-ui-sdk/compare/v1.14.0...v1.15.0
|
|
278
|
+
|
|
279
|
+
[1.14.0]: https://github.com/ReachFive/identity-web-ui-sdk/compare/v1.13.0...v1.14.0
|
|
280
|
+
|
|
281
|
+
[1.13.0]: https://github.com/ReachFive/identity-web-ui-sdk/compare/v1.12.0...v1.13.0
|
|
282
|
+
|
|
283
|
+
[1.12.0]: https://github.com/ReachFive/identity-web-ui-sdk/compare/v1.11.7...v1.12.0
|
|
284
|
+
|
|
285
|
+
[1.11.7]: https://github.com/ReachFive/identity-web-ui-sdk/compare/v1.11.6...v1.11.7
|
|
286
|
+
|
|
287
|
+
[1.11.6]: https://github.com/ReachFive/identity-web-ui-sdk/compare/v1.11.5...v1.11.6
|
|
269
288
|
|
|
270
289
|
[1.11.5]: https://github.com/ReachFive/identity-web-ui-sdk/compare/v1.11.4...v1.11.5
|
|
271
290
|
|
package/cjs/identity-ui.js
CHANGED
|
@@ -9343,6 +9343,97 @@ function identifierField(props, config) {
|
|
|
9343
9343
|
}));
|
|
9344
9344
|
}
|
|
9345
9345
|
|
|
9346
|
+
var ReCaptcha = function ReCaptcha() {
|
|
9347
|
+
_classCallCheck(this, ReCaptcha);
|
|
9348
|
+
};
|
|
9349
|
+
|
|
9350
|
+
_defineProperty(ReCaptcha, "getRecaptchaToken", /*#__PURE__*/function () {
|
|
9351
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(siteKey, action) {
|
|
9352
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
9353
|
+
while (1) {
|
|
9354
|
+
switch (_context.prev = _context.next) {
|
|
9355
|
+
case 0:
|
|
9356
|
+
_context.next = 2;
|
|
9357
|
+
return window.grecaptcha.execute(siteKey, {
|
|
9358
|
+
action: action
|
|
9359
|
+
});
|
|
9360
|
+
|
|
9361
|
+
case 2:
|
|
9362
|
+
return _context.abrupt("return", _context.sent);
|
|
9363
|
+
|
|
9364
|
+
case 3:
|
|
9365
|
+
case "end":
|
|
9366
|
+
return _context.stop();
|
|
9367
|
+
}
|
|
9368
|
+
}
|
|
9369
|
+
}, _callee);
|
|
9370
|
+
}));
|
|
9371
|
+
|
|
9372
|
+
return function (_x, _x2) {
|
|
9373
|
+
return _ref.apply(this, arguments);
|
|
9374
|
+
};
|
|
9375
|
+
}());
|
|
9376
|
+
|
|
9377
|
+
_defineProperty(ReCaptcha, "handle", /*#__PURE__*/function () {
|
|
9378
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(data, conf, callback, action) {
|
|
9379
|
+
var captchaToken;
|
|
9380
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
9381
|
+
while (1) {
|
|
9382
|
+
switch (_context2.prev = _context2.next) {
|
|
9383
|
+
case 0:
|
|
9384
|
+
if (!conf.recaptcha_enabled) {
|
|
9385
|
+
_context2.next = 13;
|
|
9386
|
+
break;
|
|
9387
|
+
}
|
|
9388
|
+
|
|
9389
|
+
_context2.prev = 1;
|
|
9390
|
+
_context2.next = 4;
|
|
9391
|
+
return ReCaptcha.getRecaptchaToken(conf.recaptcha_site_key, action);
|
|
9392
|
+
|
|
9393
|
+
case 4:
|
|
9394
|
+
captchaToken = _context2.sent;
|
|
9395
|
+
return _context2.abrupt("return", callback(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
9396
|
+
captchaToken: captchaToken
|
|
9397
|
+
})));
|
|
9398
|
+
|
|
9399
|
+
case 8:
|
|
9400
|
+
_context2.prev = 8;
|
|
9401
|
+
_context2.t0 = _context2["catch"](1);
|
|
9402
|
+
return _context2.abrupt("return", Promise.reject({
|
|
9403
|
+
errorUserMsg: "Error recaptcha",
|
|
9404
|
+
errorMessageKey: "recaptcha.error"
|
|
9405
|
+
}));
|
|
9406
|
+
|
|
9407
|
+
case 11:
|
|
9408
|
+
_context2.next = 14;
|
|
9409
|
+
break;
|
|
9410
|
+
|
|
9411
|
+
case 13:
|
|
9412
|
+
return _context2.abrupt("return", callback(data));
|
|
9413
|
+
|
|
9414
|
+
case 14:
|
|
9415
|
+
case "end":
|
|
9416
|
+
return _context2.stop();
|
|
9417
|
+
}
|
|
9418
|
+
}
|
|
9419
|
+
}, _callee2, null, [[1, 8]]);
|
|
9420
|
+
}));
|
|
9421
|
+
|
|
9422
|
+
return function (_x3, _x4, _x5, _x6) {
|
|
9423
|
+
return _ref2.apply(this, arguments);
|
|
9424
|
+
};
|
|
9425
|
+
}());
|
|
9426
|
+
function importGoogleRecaptchaScript(site_key) {
|
|
9427
|
+
var script = document.createElement("script");
|
|
9428
|
+
script.src = "https://www.google.com/recaptcha/api.js?render=" + site_key;
|
|
9429
|
+
document.body.appendChild(script);
|
|
9430
|
+
}
|
|
9431
|
+
function extractCaptchaTokenFromData(data) {
|
|
9432
|
+
var token = data.captchaToken;
|
|
9433
|
+
delete data.captchaToken;
|
|
9434
|
+
return token;
|
|
9435
|
+
}
|
|
9436
|
+
|
|
9346
9437
|
function _templateObject$7() {
|
|
9347
9438
|
var data = _taggedTemplateLiteral(["\n margin-bottom: ", "px;\n text-align: right;\n ", ";\n"]);
|
|
9348
9439
|
|
|
@@ -9414,9 +9505,10 @@ var LoginView = /*#__PURE__*/function (_React$Component) {
|
|
|
9414
9505
|
|
|
9415
9506
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
9416
9507
|
|
|
9417
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
9508
|
+
_defineProperty(_assertThisInitialized(_this), "callback", function (data) {
|
|
9418
9509
|
var specializedData = specializeIdentifierData(data);
|
|
9419
9510
|
return _this.props.apiClient.loginWithPassword(_objectSpread2(_objectSpread2({}, specializedData), {}, {
|
|
9511
|
+
captchaToken: data.captchaToken,
|
|
9420
9512
|
auth: _objectSpread2(_objectSpread2({}, specializedData.auth), _this.props.auth)
|
|
9421
9513
|
}));
|
|
9422
9514
|
});
|
|
@@ -9425,8 +9517,15 @@ var LoginView = /*#__PURE__*/function (_React$Component) {
|
|
|
9425
9517
|
}
|
|
9426
9518
|
|
|
9427
9519
|
_createClass(LoginView, [{
|
|
9520
|
+
key: "componentDidMount",
|
|
9521
|
+
value: function componentDidMount() {
|
|
9522
|
+
importGoogleRecaptchaScript(this.props.recaptcha_site_key);
|
|
9523
|
+
}
|
|
9524
|
+
}, {
|
|
9428
9525
|
key: "render",
|
|
9429
9526
|
value: function render() {
|
|
9527
|
+
var _this2 = this;
|
|
9528
|
+
|
|
9430
9529
|
var _this$props = this.props,
|
|
9431
9530
|
socialProviders = _this$props.socialProviders,
|
|
9432
9531
|
_this$props$session = _this$props.session,
|
|
@@ -9445,7 +9544,9 @@ var LoginView = /*#__PURE__*/function (_React$Component) {
|
|
|
9445
9544
|
showForgotPassword: this.props.allowForgotPassword,
|
|
9446
9545
|
canShowPassword: this.props.canShowPassword,
|
|
9447
9546
|
defaultIdentifier: defaultIdentifier,
|
|
9448
|
-
handler:
|
|
9547
|
+
handler: function handler(data) {
|
|
9548
|
+
return ReCaptcha.handle(data, _this2.props, _this2.callback, "login");
|
|
9549
|
+
},
|
|
9449
9550
|
config: this.props.config
|
|
9450
9551
|
}), this.props.allowSignup && /*#__PURE__*/React__default.createElement(Alternative, null, /*#__PURE__*/React__default.createElement("span", null, i18n('login.signupLinkPrefix')), "\xA0", /*#__PURE__*/React__default.createElement(Link, {
|
|
9451
9552
|
target: "signup"
|
|
@@ -9791,9 +9892,10 @@ var LoginView$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
9791
9892
|
|
|
9792
9893
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
9793
9894
|
|
|
9794
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
9895
|
+
_defineProperty(_assertThisInitialized(_this), "callback", function (data) {
|
|
9795
9896
|
var specializedData = specializeIdentifierData(data);
|
|
9796
9897
|
return _this.props.apiClient.loginWithPassword(_objectSpread2(_objectSpread2({}, specializedData), {}, {
|
|
9898
|
+
captchaToken: data.captchaToken,
|
|
9797
9899
|
auth: _objectSpread2(_objectSpread2({}, specializedData.auth), _this.props.auth)
|
|
9798
9900
|
}));
|
|
9799
9901
|
});
|
|
@@ -9802,8 +9904,15 @@ var LoginView$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
9802
9904
|
}
|
|
9803
9905
|
|
|
9804
9906
|
_createClass(LoginView, [{
|
|
9907
|
+
key: "componentDidMount",
|
|
9908
|
+
value: function componentDidMount() {
|
|
9909
|
+
importGoogleRecaptchaScript(this.props.recaptcha_site_key);
|
|
9910
|
+
}
|
|
9911
|
+
}, {
|
|
9805
9912
|
key: "render",
|
|
9806
9913
|
value: function render() {
|
|
9914
|
+
var _this2 = this;
|
|
9915
|
+
|
|
9807
9916
|
var i18n = this.props.i18n;
|
|
9808
9917
|
return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(Heading, null, i18n('login.title')), /*#__PURE__*/React__default.createElement(LoginWithPasswordForm, {
|
|
9809
9918
|
username: this.props.username,
|
|
@@ -9811,7 +9920,9 @@ var LoginView$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
9811
9920
|
showRememberMe: this.props.showRememberMe,
|
|
9812
9921
|
showForgotPassword: this.props.allowForgotPassword,
|
|
9813
9922
|
canShowPassword: this.props.canShowPassword,
|
|
9814
|
-
handler:
|
|
9923
|
+
handler: function handler(data) {
|
|
9924
|
+
return ReCaptcha.handle(data, _this2.props, _this2.callback, "login");
|
|
9925
|
+
},
|
|
9815
9926
|
config: this.props.config
|
|
9816
9927
|
}), /*#__PURE__*/React__default.createElement(Alternative, null, /*#__PURE__*/React__default.createElement(Link, {
|
|
9817
9928
|
target: "login-with-web-authn"
|
|
@@ -11308,8 +11419,10 @@ var PasswordSignupForm = /*#__PURE__*/function (_React$Component) {
|
|
|
11308
11419
|
blacklist: []
|
|
11309
11420
|
});
|
|
11310
11421
|
|
|
11311
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
11422
|
+
_defineProperty(_assertThisInitialized(_this), "callback", function (data) {
|
|
11423
|
+
var captchaToken = extractCaptchaTokenFromData(data);
|
|
11312
11424
|
return _this.props.apiClient.signup({
|
|
11425
|
+
captchaToken: captchaToken,
|
|
11313
11426
|
data: snakeCaseProperties(data),
|
|
11314
11427
|
auth: _this.props.auth,
|
|
11315
11428
|
redirectUrl: _this.props && _this.props.redirectUrl,
|
|
@@ -11339,8 +11452,15 @@ var PasswordSignupForm = /*#__PURE__*/function (_React$Component) {
|
|
|
11339
11452
|
}
|
|
11340
11453
|
|
|
11341
11454
|
_createClass(PasswordSignupForm, [{
|
|
11455
|
+
key: "componentDidMount",
|
|
11456
|
+
value: function componentDidMount() {
|
|
11457
|
+
importGoogleRecaptchaScript(this.props.recaptcha_site_key);
|
|
11458
|
+
}
|
|
11459
|
+
}, {
|
|
11342
11460
|
key: "render",
|
|
11343
11461
|
value: function render() {
|
|
11462
|
+
var _this2 = this;
|
|
11463
|
+
|
|
11344
11464
|
var _this$props = this.props,
|
|
11345
11465
|
_this$props$beforeSig = _this$props.beforeSignup,
|
|
11346
11466
|
beforeSignup = _this$props$beforeSig === void 0 ? function (x) {
|
|
@@ -11371,7 +11491,9 @@ var PasswordSignupForm = /*#__PURE__*/function (_React$Component) {
|
|
|
11371
11491
|
beforeSubmit: beforeSignup,
|
|
11372
11492
|
onFieldChange: this.refreshBlacklist,
|
|
11373
11493
|
sharedProps: sharedProps,
|
|
11374
|
-
handler:
|
|
11494
|
+
handler: function handler(data) {
|
|
11495
|
+
return ReCaptcha.handle(data, _this2.props, _this2.callback, "signup");
|
|
11496
|
+
}
|
|
11375
11497
|
});
|
|
11376
11498
|
}
|
|
11377
11499
|
}]);
|
|
@@ -11529,10 +11651,29 @@ var skipError = function skipError(err) {
|
|
|
11529
11651
|
};
|
|
11530
11652
|
|
|
11531
11653
|
var enhance = recompose.withHandlers({
|
|
11532
|
-
|
|
11654
|
+
callback: function callback(_ref) {
|
|
11533
11655
|
var apiClient = _ref.apiClient,
|
|
11534
11656
|
redirectUrl = _ref.redirectUrl,
|
|
11535
|
-
returnToAfterPasswordReset = _ref.returnToAfterPasswordReset
|
|
11657
|
+
returnToAfterPasswordReset = _ref.returnToAfterPasswordReset,
|
|
11658
|
+
recaptcha_enabled = _ref.recaptcha_enabled,
|
|
11659
|
+
recaptcha_site_key = _ref.recaptcha_site_key;
|
|
11660
|
+
return function (data) {
|
|
11661
|
+
return ReCaptcha.handle(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
11662
|
+
redirectUrl: redirectUrl,
|
|
11663
|
+
returnToAfterPasswordReset: returnToAfterPasswordReset
|
|
11664
|
+
}), {
|
|
11665
|
+
apiClient: apiClient,
|
|
11666
|
+
redirectUrl: redirectUrl,
|
|
11667
|
+
returnToAfterPasswordReset: returnToAfterPasswordReset,
|
|
11668
|
+
recaptcha_enabled: recaptcha_enabled,
|
|
11669
|
+
recaptcha_site_key: recaptcha_site_key
|
|
11670
|
+
}, apiClient.requestPasswordReset, "forgot_password");
|
|
11671
|
+
};
|
|
11672
|
+
},
|
|
11673
|
+
handleSubmit: function handleSubmit(_ref2) {
|
|
11674
|
+
var apiClient = _ref2.apiClient,
|
|
11675
|
+
redirectUrl = _ref2.redirectUrl,
|
|
11676
|
+
returnToAfterPasswordReset = _ref2.returnToAfterPasswordReset;
|
|
11536
11677
|
return function (data) {
|
|
11537
11678
|
return apiClient.requestPasswordReset(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
11538
11679
|
redirectUrl: redirectUrl,
|
|
@@ -11541,17 +11682,18 @@ var enhance = recompose.withHandlers({
|
|
|
11541
11682
|
};
|
|
11542
11683
|
}
|
|
11543
11684
|
});
|
|
11544
|
-
var ForgotPasswordView = enhance(function (
|
|
11545
|
-
var i18n =
|
|
11546
|
-
goTo =
|
|
11547
|
-
allowLogin =
|
|
11548
|
-
|
|
11549
|
-
displaySafeErrorMessage =
|
|
11550
|
-
showLabels =
|
|
11551
|
-
allowWebAuthnLogin =
|
|
11552
|
-
|
|
11685
|
+
var ForgotPasswordView = enhance(function (_ref3) {
|
|
11686
|
+
var i18n = _ref3.i18n,
|
|
11687
|
+
goTo = _ref3.goTo,
|
|
11688
|
+
allowLogin = _ref3.allowLogin,
|
|
11689
|
+
callback = _ref3.callback,
|
|
11690
|
+
displaySafeErrorMessage = _ref3.displaySafeErrorMessage,
|
|
11691
|
+
showLabels = _ref3.showLabels,
|
|
11692
|
+
allowWebAuthnLogin = _ref3.allowWebAuthnLogin,
|
|
11693
|
+
recaptcha_site_key = _ref3.recaptcha_site_key;
|
|
11694
|
+
return /*#__PURE__*/React__default.createElement("div", null, importGoogleRecaptchaScript(recaptcha_site_key), /*#__PURE__*/React__default.createElement(Heading, null, i18n('forgotPassword.title')), /*#__PURE__*/React__default.createElement(Intro, null, i18n('forgotPassword.prompt')), /*#__PURE__*/React__default.createElement(ForgotPasswordForm, {
|
|
11553
11695
|
showLabels: showLabels,
|
|
11554
|
-
handler:
|
|
11696
|
+
handler: callback,
|
|
11555
11697
|
onSuccess: function onSuccess() {
|
|
11556
11698
|
return goTo('forgot-password-success');
|
|
11557
11699
|
},
|
|
@@ -11560,10 +11702,10 @@ var ForgotPasswordView = enhance(function (_ref2) {
|
|
|
11560
11702
|
target: allowWebAuthnLogin ? 'login-with-web-authn' : 'login'
|
|
11561
11703
|
}, i18n('forgotPassword.backToLoginLink'))));
|
|
11562
11704
|
});
|
|
11563
|
-
var ForgotPasswordSuccessView = function ForgotPasswordSuccessView(
|
|
11564
|
-
var i18n =
|
|
11565
|
-
allowLogin =
|
|
11566
|
-
allowWebAuthnLogin =
|
|
11705
|
+
var ForgotPasswordSuccessView = function ForgotPasswordSuccessView(_ref4) {
|
|
11706
|
+
var i18n = _ref4.i18n,
|
|
11707
|
+
allowLogin = _ref4.allowLogin,
|
|
11708
|
+
allowWebAuthnLogin = _ref4.allowWebAuthnLogin;
|
|
11567
11709
|
return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(Heading, null, i18n('forgotPassword.title')), /*#__PURE__*/React__default.createElement(Info, null, i18n('forgotPassword.successMessage')), allowLogin && /*#__PURE__*/React__default.createElement(Alternative, null, /*#__PURE__*/React__default.createElement(Link, {
|
|
11568
11710
|
target: allowWebAuthnLogin ? 'login-with-web-authn' : 'login'
|
|
11569
11711
|
}, i18n('back'))));
|
|
@@ -12379,7 +12521,7 @@ var MainView$3 = /*#__PURE__*/function (_React$Component) {
|
|
|
12379
12521
|
|
|
12380
12522
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
12381
12523
|
|
|
12382
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
12524
|
+
_defineProperty(_assertThisInitialized(_this), "callback", function (data) {
|
|
12383
12525
|
return _this.props.apiClient.startPasswordless(data, _this.props.auth).then(function (_) {
|
|
12384
12526
|
return data;
|
|
12385
12527
|
});
|
|
@@ -12393,8 +12535,15 @@ var MainView$3 = /*#__PURE__*/function (_React$Component) {
|
|
|
12393
12535
|
}
|
|
12394
12536
|
|
|
12395
12537
|
_createClass(MainView, [{
|
|
12538
|
+
key: "componentDidMount",
|
|
12539
|
+
value: function componentDidMount() {
|
|
12540
|
+
importGoogleRecaptchaScript(this.props.recaptcha_site_key);
|
|
12541
|
+
}
|
|
12542
|
+
}, {
|
|
12396
12543
|
key: "render",
|
|
12397
12544
|
value: function render() {
|
|
12545
|
+
var _this2 = this;
|
|
12546
|
+
|
|
12398
12547
|
var _this$props = this.props,
|
|
12399
12548
|
i18n = _this$props.i18n,
|
|
12400
12549
|
showSocialLogins = _this$props.showSocialLogins,
|
|
@@ -12409,10 +12558,14 @@ var MainView$3 = /*#__PURE__*/function (_React$Component) {
|
|
|
12409
12558
|
}), showSocialLogins && socialProviders && socialProviders.length > 0 && /*#__PURE__*/React__default.createElement(Separator, {
|
|
12410
12559
|
text: i18n('or')
|
|
12411
12560
|
}), isEmail && showIntro && /*#__PURE__*/React__default.createElement(Intro, null, i18n('passwordless.intro')), isEmail && /*#__PURE__*/React__default.createElement(EmailInputForm, {
|
|
12412
|
-
handler:
|
|
12561
|
+
handler: function handler(data) {
|
|
12562
|
+
return ReCaptcha.handle(data, _this2.props, _this2.callback, "passwordless_email");
|
|
12563
|
+
},
|
|
12413
12564
|
onSuccess: this.handleSuccess
|
|
12414
12565
|
}), !isEmail && showIntro && /*#__PURE__*/React__default.createElement(Intro, null, i18n('passwordless.sms.intro')), !isEmail && /*#__PURE__*/React__default.createElement(PhoneNumberInputForm, {
|
|
12415
|
-
handler:
|
|
12566
|
+
handler: function handler(data) {
|
|
12567
|
+
return ReCaptcha.handle(data, _this2.props, _this2.callback, "passwordless_phone");
|
|
12568
|
+
},
|
|
12416
12569
|
onSuccess: this.handleSuccess
|
|
12417
12570
|
}));
|
|
12418
12571
|
}
|
|
@@ -12427,7 +12580,7 @@ var VerificationCodeView$1 = /*#__PURE__*/function (_React$Component2) {
|
|
|
12427
12580
|
var _super2 = _createSuper(VerificationCodeView);
|
|
12428
12581
|
|
|
12429
12582
|
function VerificationCodeView() {
|
|
12430
|
-
var
|
|
12583
|
+
var _this3;
|
|
12431
12584
|
|
|
12432
12585
|
_classCallCheck(this, VerificationCodeView);
|
|
12433
12586
|
|
|
@@ -12435,26 +12588,30 @@ var VerificationCodeView$1 = /*#__PURE__*/function (_React$Component2) {
|
|
|
12435
12588
|
args[_key2] = arguments[_key2];
|
|
12436
12589
|
}
|
|
12437
12590
|
|
|
12438
|
-
|
|
12591
|
+
_this3 = _super2.call.apply(_super2, [this].concat(args));
|
|
12439
12592
|
|
|
12440
|
-
_defineProperty(_assertThisInitialized(
|
|
12441
|
-
var
|
|
12442
|
-
apiClient =
|
|
12443
|
-
auth =
|
|
12444
|
-
phoneNumber =
|
|
12593
|
+
_defineProperty(_assertThisInitialized(_this3), "handleSubmit", function (data) {
|
|
12594
|
+
var _this3$props = _this3.props,
|
|
12595
|
+
apiClient = _this3$props.apiClient,
|
|
12596
|
+
auth = _this3$props.auth,
|
|
12597
|
+
phoneNumber = _this3$props.phoneNumber;
|
|
12445
12598
|
return apiClient.verifyPasswordless(_objectSpread2({
|
|
12446
12599
|
phoneNumber: phoneNumber
|
|
12447
12600
|
}, data), auth);
|
|
12448
12601
|
});
|
|
12449
12602
|
|
|
12450
|
-
return
|
|
12603
|
+
return _this3;
|
|
12451
12604
|
}
|
|
12452
12605
|
|
|
12453
12606
|
_createClass(VerificationCodeView, [{
|
|
12454
12607
|
key: "render",
|
|
12455
12608
|
value: function render() {
|
|
12609
|
+
var _this4 = this;
|
|
12610
|
+
|
|
12456
12611
|
return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(Info, null, this.props.i18n('passwordless.sms.verification.intro')), /*#__PURE__*/React__default.createElement(VerificationCodeInputForm$1, {
|
|
12457
|
-
handler:
|
|
12612
|
+
handler: function handler(data) {
|
|
12613
|
+
return ReCaptcha.handle(data, _this4.props, _this4.callback, "verify_passwordless_sms");
|
|
12614
|
+
}
|
|
12458
12615
|
}));
|
|
12459
12616
|
}
|
|
12460
12617
|
}]);
|