auth0-lock 12.5.0 → 12.5.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/.version CHANGED
@@ -1 +1 @@
1
- v12.5.0
1
+ v12.5.1
package/CHANGELOG.md CHANGED
@@ -1,59 +1,83 @@
1
1
  # Change Log
2
2
 
3
+ ## [v12.5.1](https://github.com/auth0/lock/tree/v12.5.1) (2024-05-30)
4
+
5
+ [Full Changelog](https://github.com/auth0/lock/compare/v12.5.0...v12.5.1)
6
+
7
+ - Swap CAPTCHA on each reload [\#2560](https://github.com/auth0/lock/pull/2560) ([josh-cain](https://github.com/josh-cain))
8
+
3
9
  ## [v12.5.0](https://github.com/auth0/lock/tree/v12.5.0) (2024-04-30)
10
+
4
11
  [Full Changelog](https://github.com/auth0/lock/compare/v12.4.0...v12.5.0)
5
12
 
6
13
  - Support captchas in reset password flow [\#2547](https://github.com/auth0/lock/pull/2547) ([srijonsaha](https://github.com/srijonsaha))
7
14
 
8
15
  ## [v12.4.0](https://github.com/auth0/lock/tree/v12.4.0) (2024-01-04)
16
+
9
17
  [Full Changelog](https://github.com/auth0/lock/compare/v12.3.1...v12.4.0)
10
18
 
11
19
  **Added**
20
+
12
21
  - [IAMRISK-2916] Added support for Auth0 v2 captcha provider [\#2503](https://github.com/auth0/lock/pull/2503) ([alexkoumarianos-okta](https://github.com/alexkoumarianos-okta))
13
22
 
14
23
  **Changed**
24
+
15
25
  - [IAMRISK-3010] Added support for auth0_v2 captcha failOpen [\#2507](https://github.com/auth0/lock/pull/2507) ([alexkoumarianos-okta](https://github.com/alexkoumarianos-okta))
16
26
 
17
27
  ## [v12.3.1](https://github.com/auth0/lock/tree/v12.3.1) (2023-11-13)
28
+
18
29
  [Full Changelog](https://github.com/auth0/lock/compare/v12.3.0...v12.3.1)
19
30
 
20
31
  **Security**
32
+
21
33
  - Bump auth0-js to solve crypto-js vulnerability [\#2492](https://github.com/auth0/lock/pull/2492) ([frederikprijck](https://github.com/frederikprijck))
22
34
 
23
35
  ## [v12.3.0](https://github.com/auth0/lock/tree/v12.3.0) (2023-10-06)
36
+
24
37
  [Full Changelog](https://github.com/auth0/lock/compare/v12.2.0...v12.3.0)
25
38
 
26
39
  **Added**
40
+
27
41
  - [IAMRISK-2603] Add support for Arkose [\#2455](https://github.com/auth0/lock/pull/2455) ([srijonsaha](https://github.com/srijonsaha))
28
42
 
29
43
  ## [v12.2.0](https://github.com/auth0/lock/tree/v12.2.0) (2023-09-15)
44
+
30
45
  [Full Changelog](https://github.com/auth0/lock/compare/v12.1.0...v12.2.0)
31
46
 
32
47
  **Added**
48
+
33
49
  - Wrap CheckBoxInput in InputWrapper to provide visual feedback [\#2423](https://github.com/auth0/lock/pull/2423) ([ewanharris](https://github.com/ewanharris))
34
50
 
35
51
  ## [v12.1.0](https://github.com/auth0/lock/tree/v12.1.0) (2023-07-17)
52
+
36
53
  [Full Changelog](https://github.com/auth0/lock/compare/v12.0.2...v12.1.0)
37
54
 
38
55
  **Added**
56
+
39
57
  - Added support for hCaptcha and Friendly Captcha [\#2387](https://github.com/auth0/lock/pull/2387) ([DominickBattistini](https://github.com/DominickBattistini))
40
58
 
41
59
  **Changed**
60
+
42
61
  - WelcomeMessage header text marked as heading [\#2373](https://github.com/auth0/lock/pull/2373) ([piwysocki](https://github.com/piwysocki))
43
62
 
44
63
  ## [v12.0.2](https://github.com/auth0/lock/tree/v12.0.2) (2023-02-10)
64
+
45
65
  [Full Changelog](https://github.com/auth0/lock/compare/v12.0.1...v12.0.2)
46
66
 
47
67
  **Changed**
68
+
48
69
  - Slight tweaks to Captcha input component handler methods + refresh button mask [\#2272](https://github.com/auth0/lock/pull/2272) ([stevehobbsdev](https://github.com/stevehobbsdev))
49
70
 
50
71
  **Fixed**
72
+
51
73
  - Fix for when component is undefined on unmount [\#2271](https://github.com/auth0/lock/pull/2271) ([codetheweb](https://github.com/codetheweb))
52
74
 
53
75
  ## [v12.0.1](https://github.com/auth0/lock/tree/v12.0.1) (2023-02-01)
76
+
54
77
  [Full Changelog](https://github.com/auth0/lock/compare/v12.0.0...v12.0.1)
55
78
 
56
79
  **Changed**
80
+
57
81
  - FDR-487 - feat: update microsoft button [\#2259](https://github.com/auth0/lock/pull/2259) ([jamescgarrett](https://github.com/jamescgarrett))
58
82
 
59
83
  ## [v12.0.0](https://github.com/auth0/lock/tree/v12.0.0) (2023-01-20)
@@ -99,6 +123,7 @@ Despite the major version bump, **v12 is completely API-compatible with v11**.
99
123
  - Upgrade to React 18 [\#2209](https://github.com/auth0/lock/pull/2209) ([stevehobbsdev](https://github.com/stevehobbsdev))
100
124
  - Upgrade to Webpack 5, Jest 29, Babel 8 [\#2213](https://github.com/auth0/lock/pull/2213) ([stevehobbsdev](https://github.com/stevehobbsdev))
101
125
  - bump dependencies to latest patch and fix typos [\#2210](https://github.com/auth0/lock/pull/2210) ([piwysocki](https://github.com/piwysocki))
126
+
102
127
  ## [v11.34.2](https://github.com/auth0/lock/tree/v11.34.2) (2022-10-10)
103
128
 
104
129
  [Full Changelog](https://github.com/auth0/lock/compare/v11.34.1...v11.34.2)
package/README.md CHANGED
@@ -30,8 +30,9 @@ From CDN
30
30
 
31
31
  ```html
32
32
  <!-- Latest patch release (recommended for production) -->
33
- <script src="https://cdn.auth0.com/js/lock/12.5.0/lock.min.js"></script>
33
+ <script src="https://cdn.auth0.com/js/lock/12.5.1/lock.min.js"></script>
34
34
  ```
35
+
35
36
  ### Configure Auth0
36
37
 
37
38
  Create a **Single Page Application** in the [Auth0 Dashboard](https://manage.auth0.com/#/applications).
@@ -1,11 +1,17 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
3
  var _immutable = _interopRequireWildcard(require("immutable"));
5
4
  var _actions = require("../../../connection/database/actions");
6
5
  var _store = require("../../../store");
6
+ var _captcha = require("../../../connection/captcha");
7
7
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
8
8
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
9
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
15
  var webApiMock = function webApiMock() {
10
16
  return require('core/web_api');
11
17
  };
@@ -17,6 +23,16 @@ jest.mock('core/actions', function () {
17
23
  validateAndSubmit: jest.fn()
18
24
  };
19
25
  });
26
+ jest.mock('../../../connection/captcha', function () {
27
+ var originalCaptcha = jest.requireActual('../../../connection/captcha');
28
+ return _objectSpread(_objectSpread({
29
+ __esModule: true
30
+ }, originalCaptcha), {}, {
31
+ swapCaptcha: jest.fn(function (id, flow, wasInvalid, next) {
32
+ next();
33
+ })
34
+ });
35
+ });
20
36
  jest.mock('core/web_api', function () {
21
37
  return {
22
38
  signUp: jest.fn()
@@ -225,4 +241,89 @@ describe('database/actions.js', function () {
225
241
  }
226
242
  });
227
243
  });
244
+ describe('exported functions', function () {
245
+ var id = 2;
246
+ var mCaptcha = _immutable.default.fromJS({
247
+ field: {
248
+ email: {
249
+ value: 'test@email.com'
250
+ },
251
+ password: {
252
+ value: 'testpass'
253
+ },
254
+ family_name: {
255
+ value: 'test-family-name'
256
+ },
257
+ given_name: {
258
+ value: 'test-given-name'
259
+ },
260
+ name: {
261
+ value: 'test-name'
262
+ },
263
+ nickname: {
264
+ value: 'test-nickname'
265
+ },
266
+ picture: {
267
+ value: 'test-pic'
268
+ },
269
+ other_prop: {
270
+ value: 'test-other'
271
+ }
272
+ },
273
+ database: {
274
+ additionalSignUpFields: [{
275
+ name: 'family_name',
276
+ storage: 'root'
277
+ }, {
278
+ name: 'given_name',
279
+ storage: 'root'
280
+ }, {
281
+ name: 'name',
282
+ storage: 'root'
283
+ }, {
284
+ name: 'nickname',
285
+ storage: 'root'
286
+ }, {
287
+ name: 'picture',
288
+ storage: 'root'
289
+ }, {
290
+ name: 'other_prop'
291
+ }]
292
+ },
293
+ captcha: {
294
+ provider: 'auth0'
295
+ },
296
+ passwordResetCaptcha: {
297
+ provider: 'auth0'
298
+ }
299
+ });
300
+ describe('resetPasswordSuccess', function () {
301
+ it('runs swap CAPTCHA', function () {
302
+ (0, _store.swap)(_store.setEntity, 'lock', id, mCaptcha);
303
+ (0, _actions.resetPasswordSuccess)(id);
304
+ expect(_captcha.swapCaptcha.mock.calls.length).toEqual(1);
305
+ });
306
+ });
307
+ describe('showResetPasswordActivity', function () {
308
+ it('runs swap CAPTCHA', function () {
309
+ (0, _store.swap)(_store.setEntity, 'lock', id, mCaptcha);
310
+ (0, _actions.showResetPasswordActivity)(id);
311
+ expect(_captcha.swapCaptcha.mock.calls.length).toEqual(1);
312
+ });
313
+ });
314
+ describe('showLoginActivity', function () {
315
+ it('runs swap CAPTCHA', function () {
316
+ (0, _store.swap)(_store.setEntity, 'lock', id, mCaptcha);
317
+ (0, _actions.showLoginActivity)(id);
318
+ expect(_captcha.swapCaptcha.mock.calls.length).toEqual(1);
319
+ });
320
+ });
321
+ describe('showSignupActivity', function () {
322
+ it('runs swap CAPTCHA', function () {
323
+ (0, _store.swap)(_store.setEntity, 'lock', id, mCaptcha);
324
+ (0, _actions.showSignUpActivity)(id);
325
+ expect(_captcha.swapCaptcha.mock.calls.length).toEqual(1);
326
+ });
327
+ });
328
+ });
228
329
  });
@@ -8,6 +8,7 @@ exports.cancelMFALogin = cancelMFALogin;
8
8
  exports.cancelResetPassword = cancelResetPassword;
9
9
  exports.logIn = logIn;
10
10
  exports.resetPassword = resetPassword;
11
+ exports.resetPasswordSuccess = resetPasswordSuccess;
11
12
  exports.showLoginActivity = showLoginActivity;
12
13
  exports.showLoginMFAActivity = showLoginMFAActivity;
13
14
  exports.showResetPasswordActivity = showResetPasswordActivity;
@@ -247,10 +248,12 @@ function resetPassword(id) {
247
248
  function resetPasswordSuccess(id) {
248
249
  var m = (0, _index.read)(_index.getEntity, 'lock', id);
249
250
  if ((0, _index4.hasScreen)(m, 'login')) {
250
- (0, _index.swap)(_index.updateEntity, 'lock', id, function (m) {
251
- return (0, _index4.setScreen)(l.setSubmitting(m, false), 'login', ['']);
252
- } // array with one empty string tells the function to not clear any field
253
- );
251
+ (0, _captcha.swapCaptcha)(id, _captcha.Flow.PASSWORD_RESET, false, function () {
252
+ (0, _index.swap)(_index.updateEntity, 'lock', id, function (m) {
253
+ return (0, _index4.setScreen)(l.setSubmitting(m, false), 'login', ['']);
254
+ } // array with one empty string tells the function to not clear any field
255
+ );
256
+ });
254
257
 
255
258
  // TODO: should be handled by box
256
259
  setTimeout(function () {
@@ -261,8 +264,10 @@ function resetPasswordSuccess(id) {
261
264
  if (l.ui.autoclose(m)) {
262
265
  (0, _actions.closeLock)(id);
263
266
  } else {
264
- (0, _index.swap)(_index.updateEntity, 'lock', id, function (m) {
265
- return l.setSubmitting(m, false).set('passwordResetted', true);
267
+ (0, _captcha.swapCaptcha)(id, _captcha.Flow.PASSWORD_RESET, false, function () {
268
+ (0, _index.swap)(_index.updateEntity, 'lock', id, function (m) {
269
+ return l.setSubmitting(m, false).set('passwordResetted', true);
270
+ });
266
271
  });
267
272
  }
268
273
  }
@@ -281,15 +286,39 @@ function resetPasswordError(id, error) {
281
286
  }
282
287
  function showLoginActivity(id) {
283
288
  var fields = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['password'];
284
- (0, _index.swap)(_index.updateEntity, 'lock', id, _index4.setScreen, 'login', fields);
289
+ var m = (0, _index.read)(_index.getEntity, 'lock', id);
290
+ var captchaConfig = l.captcha(m);
291
+ if (captchaConfig && captchaConfig.get('provider') === 'arkose') {
292
+ (0, _index.swap)(_index.updateEntity, 'lock', id, _index4.setScreen, 'login', fields);
293
+ } else {
294
+ (0, _captcha.swapCaptcha)(id, 'login', false, function () {
295
+ (0, _index.swap)(_index.updateEntity, 'lock', id, _index4.setScreen, 'login', fields);
296
+ });
297
+ }
285
298
  }
286
299
  function showSignUpActivity(id) {
287
300
  var fields = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['password'];
288
- (0, _index.swap)(_index.updateEntity, 'lock', id, _index4.setScreen, 'signUp', fields);
301
+ var m = (0, _index.read)(_index.getEntity, 'lock', id);
302
+ var captchaConfig = l.captcha(m);
303
+ if (captchaConfig && captchaConfig.get('provider') === 'arkose') {
304
+ (0, _index.swap)(_index.updateEntity, 'lock', id, _index4.setScreen, 'signUp', fields);
305
+ } else {
306
+ (0, _captcha.swapCaptcha)(id, 'login', false, function () {
307
+ (0, _index.swap)(_index.updateEntity, 'lock', id, _index4.setScreen, 'signUp', fields);
308
+ });
309
+ }
289
310
  }
290
311
  function showResetPasswordActivity(id) {
291
312
  var fields = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['password'];
292
- (0, _index.swap)(_index.updateEntity, 'lock', id, _index4.setScreen, 'forgotPassword', fields);
313
+ var m = (0, _index.read)(_index.getEntity, 'lock', id);
314
+ var captchaConfig = l.passwordResetCaptcha(m);
315
+ if (captchaConfig && captchaConfig.get('provider') === 'arkose') {
316
+ (0, _index.swap)(_index.updateEntity, 'lock', id, _index4.setScreen, 'forgotPassword', fields);
317
+ } else {
318
+ (0, _captcha.swapCaptcha)(id, 'login', false, function () {
319
+ (0, _index.swap)(_index.updateEntity, 'lock', id, _index4.setScreen, 'forgotPassword', fields);
320
+ });
321
+ }
293
322
  }
294
323
  function cancelResetPassword(id) {
295
324
  return showLoginActivity(id);
@@ -169,5 +169,5 @@ function trimAuthParams() {
169
169
  return p;
170
170
  }
171
171
  function getVersion() {
172
- return "12.5.0";
172
+ return "12.5.1";
173
173
  }
package/lib/i18n.js CHANGED
@@ -91,7 +91,7 @@ function assertLanguage(m, language, base) {
91
91
  function syncLang(m, language, _cb) {
92
92
  (0, _cdn_utils.load)({
93
93
  method: 'registerLanguageDictionary',
94
- url: "".concat(l.languageBaseUrl(m), "/js/lock/").concat("12.5.0", "/").concat(language, ".js"),
94
+ url: "".concat(l.languageBaseUrl(m), "/js/lock/").concat("12.5.1", "/").concat(language, ".js"),
95
95
  check: function check(str) {
96
96
  return str && str === language;
97
97
  },
package/lib/lock.js CHANGED
@@ -37,7 +37,7 @@ var Auth0Lock = exports.default = /*#__PURE__*/function (_Core) {
37
37
  _inherits(Auth0Lock, _Core);
38
38
  return _createClass(Auth0Lock);
39
39
  }(_core.default); // telemetry
40
- Auth0Lock.version = "12.5.0";
40
+ Auth0Lock.version = "12.5.1";
41
41
 
42
42
  // TODO: should we have different telemetry for classic/passwordless?
43
43
  // TODO: should we set telemetry info before each request?
@@ -37,4 +37,4 @@ var Auth0LockPasswordless = exports.default = /*#__PURE__*/function (_Core) {
37
37
  _inherits(Auth0LockPasswordless, _Core);
38
38
  return _createClass(Auth0LockPasswordless);
39
39
  }(_core.default);
40
- Auth0LockPasswordless.version = "12.5.0";
40
+ Auth0LockPasswordless.version = "12.5.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auth0-lock",
3
- "version": "12.5.0",
3
+ "version": "12.5.1",
4
4
  "description": "Auth0 Lock",
5
5
  "author": "Auth0 <support@auth0.com> (http://auth0.com)",
6
6
  "license": "MIT",
@@ -61,7 +61,7 @@
61
61
  "@babel/plugin-syntax-import-meta": "^7.0.0",
62
62
  "@babel/preset-env": "^7.0.0",
63
63
  "@babel/preset-react": "^7.0.0",
64
- "@cfaester/enzyme-adapter-react-18": "^0.7.0",
64
+ "@cfaester/enzyme-adapter-react-18": "^0.8.0",
65
65
  "@google-cloud/translate": "^6.0.2",
66
66
  "babel-jest": "^29.3.1",
67
67
  "babel-loader": "8.3.0",
@@ -111,7 +111,7 @@
111
111
  "puppeteer": "^10.1.0",
112
112
  "react-test-renderer": "^18.2.0",
113
113
  "sinon": "^1.15.4",
114
- "stylus": "^0.62.0",
114
+ "stylus": "^0.63.0",
115
115
  "stylus-loader": "^3.0.2",
116
116
  "tmp": "^0.2.1",
117
117
  "unminified-webpack-plugin": "^3.0.0",