auth0-lock 12.5.1 → 13.1.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.
@@ -1 +1 @@
1
- * @auth0/dx-sdks-engineer
1
+ * @auth0/project-dx-sdks-engineer-codeowner
@@ -2,7 +2,7 @@ name: Semgrep
2
2
 
3
3
  on:
4
4
  merge_group:
5
- pull_request_target:
5
+ pull_request:
6
6
  types:
7
7
  - opened
8
8
  - synchronize
@@ -20,16 +20,7 @@ concurrency:
20
20
  cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
21
21
 
22
22
  jobs:
23
- authorize:
24
- name: Authorize
25
- environment: ${{ github.actor != 'dependabot[bot]' && github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }}
26
- runs-on: ubuntu-latest
27
- steps:
28
- - run: true
29
-
30
23
  run:
31
- needs: authorize # Require approval before running on forked pull requests
32
-
33
24
  name: Check for Vulnerabilities
34
25
  runs-on: ubuntu-latest
35
26
 
@@ -3,7 +3,7 @@ name: Snyk
3
3
  on:
4
4
  merge_group:
5
5
  workflow_dispatch:
6
- pull_request_target:
6
+ pull_request:
7
7
  types:
8
8
  - opened
9
9
  - synchronize
@@ -21,16 +21,7 @@ concurrency:
21
21
  cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
22
22
 
23
23
  jobs:
24
- authorize:
25
- name: Authorize
26
- environment: ${{ github.actor != 'dependabot[bot]' && github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }}
27
- runs-on: ubuntu-latest
28
- steps:
29
- - run: true
30
-
31
24
  check:
32
- needs: authorize
33
-
34
25
  name: Check for Vulnerabilities
35
26
  runs-on: ubuntu-latest
36
27
 
package/.version CHANGED
@@ -1 +1 @@
1
- v12.5.1
1
+ v13.1.0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Change Log
2
2
 
3
+ ## [v13.1.0](https://github.com/auth0/lock/tree/v13.1.0) (2025-07-17)
4
+
5
+ **Added**
6
+ - Add support for social connection Sign in with Shop [\#2602](https://github.com/auth0/lock/pull/2602) ([reinisb](https://github.com/reinisb))
7
+ - fix: Rename shop strategy [\#2641](https://github.com/auth0/lock/pull/2641) ([omarquazi-okta](https://github.com/omarquazi-okta))
8
+
9
+ ## [v13.0.0](https://github.com/auth0/lock/tree/v13.0.0) (2024-11-11)
10
+ [Full Changelog](https://github.com/auth0/lock/compare/v12.5.1...v13.0.0)
11
+
12
+ **Added**
13
+ - [IAMRISK-3539] Use signup classic endpoint for captcha [\#2587](https://github.com/auth0/lock/pull/2587) ([TSLarson](https://github.com/TSLarson))
14
+
15
+ **Fixed**
16
+ - [IAMRISK-3554] hcaptcha bug fix [\#2566](https://github.com/auth0/lock/pull/2566) ([Treterten](https://github.com/Treterten))
17
+
18
+ **Security**
19
+ - ci: changed the trigger from pull_request_target to pull_request for better security [\#2584](https://github.com/auth0/lock/pull/2584) ([nandan-bhat](https://github.com/nandan-bhat))
20
+ - Update codeowner file with new GitHub team name [\#2572](https://github.com/auth0/lock/pull/2572) ([stevenwong-okta](https://github.com/stevenwong-okta))
21
+
3
22
  ## [v12.5.1](https://github.com/auth0/lock/tree/v12.5.1) (2024-05-30)
4
23
 
5
24
  [Full Changelog](https://github.com/auth0/lock/compare/v12.5.0...v12.5.1)
package/Makefile CHANGED
@@ -1,12 +1,24 @@
1
1
  #!/usr/bin/env make
2
2
 
3
- #SHELL := /bin/bash
4
- #.SHELLFLAGS = -ec
3
+ # SHELL := /bin/bash
4
+ # .SHELLFLAGS = -ec
5
5
 
6
- .PHONY: install lint test build cdn-publish
6
+ .PHONY: install lint test build publish
7
+
8
+ # Puppeteer and config/cache directories
9
+ PUPPETEER_CACHE_DIR := $(CURDIR)/.puppeteer-cache
10
+ XDG_CONFIG_HOME := $(WORKSPACE)@tmp/.chromium
11
+ XDG_CACHE_HOME := $(WORKSPACE)@tmp/.chromium
7
12
 
8
13
  install:
9
14
  @echo "Running install..."
15
+ mkdir -p $(PUPPETEER_CACHE_DIR)
16
+ mkdir -p $(XDG_CONFIG_HOME)
17
+ mkdir -p $(XDG_CACHE_HOME)
18
+ XDG_CONFIG_HOME=$(XDG_CONFIG_HOME) \
19
+ XDG_CACHE_HOME=$(XDG_CACHE_HOME) \
20
+ PUPPETEER_CACHE_DIR=$(PUPPETEER_CACHE_DIR) \
21
+ PUPPETEER_SKIP_DOWNLOAD=true \
10
22
  npm install
11
23
 
12
24
  test:
@@ -19,4 +31,4 @@ build:
19
31
 
20
32
  publish:
21
33
  @echo "Running cdn-publish..."
22
- npm run publish:cdn
34
+ npm run publish:cdn
package/README.md CHANGED
@@ -30,7 +30,7 @@ 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.1/lock.min.js"></script>
33
+ <script src="https://cdn.auth0.com/js/lock/13.1.0/lock.min.js"></script>
34
34
  ```
35
35
 
36
36
  ### Configure Auth0
@@ -3,6 +3,7 @@
3
3
  var _react = _interopRequireDefault(require("react"));
4
4
  var _testUtils = require("testUtils");
5
5
  var _testUtils2 = require("../../testUtils");
6
+ var _captcha = require("../../../connection/captcha");
6
7
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7
8
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
8
9
  jest.mock('field/email/email_pane', function () {
@@ -19,7 +20,7 @@ jest.mock('field/custom_input', function () {
19
20
  });
20
21
  jest.mock('core/index', function () {
21
22
  return {
22
- captcha: jest.fn()
23
+ signupCaptcha: jest.fn()
23
24
  };
24
25
  });
25
26
  jest.mock('engine/classic', function () {
@@ -73,6 +74,7 @@ describe('SignUpPane', function () {
73
74
  return keys.join(',');
74
75
  }
75
76
  },
77
+ flow: _captcha.Flow.SIGNUP,
76
78
  model: 'model',
77
79
  emailInputPlaceholder: 'emailInputPlaceholder',
78
80
  onlyEmail: true,
@@ -92,7 +94,7 @@ describe('SignUpPane', function () {
92
94
  }))).toMatchSnapshot();
93
95
  });
94
96
  it('shows the Captcha pane', function () {
95
- require('core/index').captcha.mockReturnValue({
97
+ require('core/index').signupCaptcha.mockReturnValue({
96
98
  get: function get() {
97
99
  return true;
98
100
  }
@@ -102,7 +104,7 @@ describe('SignUpPane', function () {
102
104
  (0, _testUtils2.expectShallowComponent)( /*#__PURE__*/_react.default.createElement(Component, defaultProps)).toMatchSnapshot();
103
105
  });
104
106
  it('hides the Captcha pane for SSO connections', function () {
105
- require('core/index').captcha.mockReturnValue({
107
+ require('core/index').signupCaptcha.mockReturnValue({
106
108
  get: function get() {
107
109
  return true;
108
110
  }
@@ -112,7 +114,7 @@ describe('SignUpPane', function () {
112
114
  (0, _testUtils2.expectShallowComponent)( /*#__PURE__*/_react.default.createElement(Component, defaultProps)).toMatchSnapshot();
113
115
  });
114
116
  it('shows the Captcha pane for SSO (ADFS) connections', function () {
115
- require('core/index').captcha.mockReturnValue({
117
+ require('core/index').signupCaptcha.mockReturnValue({
116
118
  get: function get() {
117
119
  return true;
118
120
  }
@@ -158,13 +158,22 @@ describe('ThirdPartyCaptcha', function () {
158
158
  });
159
159
  });
160
160
  it('should call render with the correct renderParams', function () {
161
- var renderParams = global.window.hcaptcha.render.mock.calls[0][1];
161
+ var renderCalls = global.window.hcaptcha.render.mock.calls;
162
+ var renderParams = renderCalls[0][1];
162
163
  expect(renderParams).toEqual({
163
164
  sitekey: 'mySiteKey',
164
165
  callback: expect.any(Function),
165
166
  'expired-callback': expect.any(Function),
166
167
  'error-callback': expect.any(Function)
167
168
  });
169
+ expect(renderCalls.length).toEqual(1);
170
+ });
171
+ it('should call render on update', function () {
172
+ (0, _testUtils.act)(function () {
173
+ wrapper.setState();
174
+ var renderCalls = global.window.hcaptcha.render.mock.calls;
175
+ expect(renderCalls.length).toEqual(1);
176
+ });
168
177
  });
169
178
  });
170
179
  describe('auth0_v2', function () {
@@ -19,13 +19,14 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
19
19
  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; }
20
20
  var Flow = exports.Flow = Object.freeze({
21
21
  DEFAULT: 'default',
22
+ SIGNUP: 'signup',
22
23
  PASSWORDLESS: 'passwordless',
23
24
  PASSWORD_RESET: 'password_reset'
24
25
  });
25
26
 
26
27
  /**
27
28
  * Return the captcha config object based on the type of flow.
28
- *
29
+ *
29
30
  * @param {Object} m model
30
31
  * @param {Flow} flow Which flow the captcha is being rendered in
31
32
  */
@@ -34,6 +35,8 @@ function getCaptchaConfig(m, flow) {
34
35
  return l.passwordResetCaptcha(m);
35
36
  } else if (flow === Flow.PASSWORDLESS) {
36
37
  return l.passwordlessCaptcha(m);
38
+ } else if (flow === Flow.SIGNUP) {
39
+ return l.signupCaptcha(m);
37
40
  } else {
38
41
  return l.captcha(m);
39
42
  }
@@ -111,6 +114,15 @@ function swapCaptcha(id, flow, wasInvalid, next) {
111
114
  next();
112
115
  }
113
116
  });
117
+ } else if (flow === Flow.SIGNUP) {
118
+ return _web_api.default.getSignupChallenge(id, function (err, newCaptcha) {
119
+ if (!err && newCaptcha) {
120
+ (0, _index3.swap)(_index3.updateEntity, 'lock', id, l.setSignupChallenge, newCaptcha, wasInvalid);
121
+ }
122
+ if (next) {
123
+ next();
124
+ }
125
+ });
114
126
  } else {
115
127
  return _web_api.default.getChallenge(id, function (err, newCaptcha) {
116
128
  if (!err && newCaptcha) {
@@ -85,9 +85,9 @@ function signUp(id) {
85
85
  password: c.getFieldValue(m, 'password'),
86
86
  autoLogin: (0, _index4.shouldAutoLogin)(m)
87
87
  };
88
- var isCaptchaValid = (0, _captcha.setCaptchaParams)(m, params, _captcha.Flow.DEFAULT, fields);
88
+ var isCaptchaValid = (0, _captcha.setCaptchaParams)(m, params, _captcha.Flow.SIGNUP, fields);
89
89
  if (!isCaptchaValid) {
90
- return (0, _captcha.showMissingCaptcha)(m, id);
90
+ return (0, _captcha.showMissingCaptcha)(m, id, _captcha.Flow.SIGNUP);
91
91
  }
92
92
  if ((0, _index4.databaseConnectionRequiresUsername)(m)) {
93
93
  if ((0, _index4.signUpHideUsernameField)(m)) {
@@ -126,7 +126,7 @@ function signUp(id) {
126
126
  popupHandler._current_popup.kill();
127
127
  }
128
128
  var wasInvalidCaptcha = error && error.code === 'invalid_captcha';
129
- (0, _captcha.swapCaptcha)(id, _captcha.Flow.DEFAULT, wasInvalidCaptcha, function () {
129
+ (0, _captcha.swapCaptcha)(id, _captcha.Flow.SIGNUP, wasInvalidCaptcha, function () {
130
130
  setTimeout(function () {
131
131
  return signUpError(id, error);
132
132
  }, 250);
@@ -299,11 +299,11 @@ function showLoginActivity(id) {
299
299
  function showSignUpActivity(id) {
300
300
  var fields = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['password'];
301
301
  var m = (0, _index.read)(_index.getEntity, 'lock', id);
302
- var captchaConfig = l.captcha(m);
302
+ var captchaConfig = l.signupCaptcha(m);
303
303
  if (captchaConfig && captchaConfig.get('provider') === 'arkose') {
304
304
  (0, _index.swap)(_index.updateEntity, 'lock', id, _index4.setScreen, 'signUp', fields);
305
305
  } else {
306
- (0, _captcha.swapCaptcha)(id, 'login', false, function () {
306
+ (0, _captcha.swapCaptcha)(id, _captcha.Flow.SIGNUP, false, function () {
307
307
  (0, _index.swap)(_index.updateEntity, 'lock', id, _index4.setScreen, 'signUp', fields);
308
308
  });
309
309
  }
@@ -315,7 +315,7 @@ function showResetPasswordActivity(id) {
315
315
  if (captchaConfig && captchaConfig.get('provider') === 'arkose') {
316
316
  (0, _index.swap)(_index.updateEntity, 'lock', id, _index4.setScreen, 'forgotPassword', fields);
317
317
  } else {
318
- (0, _captcha.swapCaptcha)(id, 'login', false, function () {
318
+ (0, _captcha.swapCaptcha)(id, _captcha.Flow.PASSWORD_RESET, false, function () {
319
319
  (0, _index.swap)(_index.updateEntity, 'lock', id, _index4.setScreen, 'forgotPassword', fields);
320
320
  });
321
321
  }
@@ -24,7 +24,8 @@ exports.showTerms = showTerms;
24
24
  exports.termsAccepted = termsAccepted;
25
25
  exports.toggleTermsAcceptance = toggleTermsAcceptance;
26
26
  var _immutable = _interopRequireWildcard(require("immutable"));
27
- var l = _interopRequireWildcard(require("../../core/index"));
27
+ var _index = _interopRequireWildcard(require("../../core/index"));
28
+ var l = _index;
28
29
  var _index2 = require("../../field/index");
29
30
  var _phone_number = require("../../field/phone_number");
30
31
  var _data_utils = require("../../utils/data_utils");
@@ -49,6 +50,14 @@ function initPasswordless(m, opts) {
49
50
  mustAcceptTerms: mustAcceptTerms,
50
51
  showTerms: showTerms
51
52
  }));
53
+ m = (0, _sync.default)(m, 'passwordlessCaptcha', {
54
+ syncFn: function syncFn(m, cb) {
55
+ _web_api.default.getPasswordlessChallenge(m.get('id'), function (err, r) {
56
+ cb(null, r);
57
+ });
58
+ },
59
+ successFn: _index.setPasswordlessCaptcha
60
+ });
52
61
  if (opts.defaultLocation && typeof opts.defaultLocation === 'string') {
53
62
  m = (0, _phone_number.initLocation)(m, opts.defaultLocation.toUpperCase());
54
63
  } else {
@@ -44,6 +44,7 @@ var STRATEGIES = exports.STRATEGIES = {
44
44
  evernote: 'Evernote',
45
45
  'evernote-sandbox': 'Evernote (sandbox)',
46
46
  shopify: 'Shopify',
47
+ shop: 'Shop',
47
48
  soundcloud: 'Soundcloud',
48
49
  thecity: 'The City',
49
50
  'thecity-sandbox': 'The City (sandbox)',
package/lib/core/index.js CHANGED
@@ -58,10 +58,12 @@ exports.setLoggedIn = setLoggedIn;
58
58
  exports.setPasswordResetCaptcha = setPasswordResetCaptcha;
59
59
  exports.setPasswordlessCaptcha = setPasswordlessCaptcha;
60
60
  exports.setResolvedConnection = setResolvedConnection;
61
+ exports.setSignupChallenge = setSignupChallenge;
61
62
  exports.setSubmitting = setSubmitting;
62
63
  exports.setSupressSubmitOverlay = setSupressSubmitOverlay;
63
64
  exports.setup = setup;
64
65
  exports.showBadge = showBadge;
66
+ exports.signupCaptcha = signupCaptcha;
65
67
  exports.stop = stop;
66
68
  exports.stopRendering = stopRendering;
67
69
  exports.submitting = submitting;
@@ -488,6 +490,10 @@ function setCaptcha(m, value, wasInvalid) {
488
490
  m = captchaField.reset(m, wasInvalid);
489
491
  return set(m, 'captcha', _immutable.default.fromJS(value));
490
492
  }
493
+ function setSignupChallenge(m, value, wasInvalid) {
494
+ m = captchaField.reset(m, wasInvalid);
495
+ return set(m, 'signupCaptcha', _immutable.default.fromJS(value));
496
+ }
491
497
  function setPasswordlessCaptcha(m, value, wasInvalid) {
492
498
  m = captchaField.reset(m, wasInvalid);
493
499
  return set(m, 'passwordlessCaptcha', _immutable.default.fromJS(value));
@@ -499,6 +505,9 @@ function setPasswordResetCaptcha(m, value, wasInvalid) {
499
505
  function captcha(m) {
500
506
  return get(m, 'captcha');
501
507
  }
508
+ function signupCaptcha(m) {
509
+ return get(m, 'signupCaptcha');
510
+ }
502
511
  function passwordlessCaptcha(m) {
503
512
  return get(m, 'passwordlessCaptcha');
504
513
  }
@@ -78,21 +78,5 @@ function syncRemoteData(m) {
78
78
  },
79
79
  successFn: _index2.setCaptcha
80
80
  });
81
- m = (0, _sync.default)(m, 'passwordlessCaptcha', {
82
- syncFn: function syncFn(m, cb) {
83
- _web_api.default.getPasswordlessChallenge(m.get('id'), function (err, r) {
84
- cb(null, r);
85
- });
86
- },
87
- successFn: _index2.setPasswordlessCaptcha
88
- });
89
- m = (0, _sync.default)(m, 'passwordResetCaptcha', {
90
- syncFn: function syncFn(m, cb) {
91
- _web_api.default.getPasswordResetChallenge(m.get('id'), function (err, r) {
92
- cb(null, r);
93
- });
94
- },
95
- successFn: _index2.setPasswordResetCaptcha
96
- });
97
81
  return m;
98
82
  }
@@ -169,5 +169,5 @@ function trimAuthParams() {
169
169
  return p;
170
170
  }
171
171
  function getVersion() {
172
- return "12.5.1";
172
+ return "13.1.0";
173
173
  }
@@ -192,6 +192,12 @@ var Auth0APIClient = /*#__PURE__*/function () {
192
192
  var _this$client$client2;
193
193
  return (_this$client$client2 = this.client.client).getChallenge.apply(_this$client$client2, arguments);
194
194
  }
195
+ }, {
196
+ key: "getSignupChallenge",
197
+ value: function getSignupChallenge() {
198
+ var _this$client$client$d;
199
+ return (_this$client$client$d = this.client.client.dbConnection).getSignupChallenge.apply(_this$client$client$d, arguments);
200
+ }
195
201
  }, {
196
202
  key: "getPasswordlessChallenge",
197
203
  value: function getPasswordlessChallenge() {
@@ -201,8 +207,8 @@ var Auth0APIClient = /*#__PURE__*/function () {
201
207
  }, {
202
208
  key: "getPasswordResetChallenge",
203
209
  value: function getPasswordResetChallenge() {
204
- var _this$client$client$d;
205
- return (_this$client$client$d = this.client.client.dbConnection).getPasswordResetChallenge.apply(_this$client$client$d, arguments);
210
+ var _this$client$client$d2;
211
+ return (_this$client$client$d2 = this.client.client.dbConnection).getPasswordResetChallenge.apply(_this$client$client$d2, arguments);
206
212
  }
207
213
  }, {
208
214
  key: "getUserCountry",
@@ -84,6 +84,11 @@ var Auth0WebAPI = /*#__PURE__*/function () {
84
84
  value: function getChallenge(lockID, callback) {
85
85
  return this.clients[lockID].getChallenge(callback);
86
86
  }
87
+ }, {
88
+ key: "getSignupChallenge",
89
+ value: function getSignupChallenge(lockID, callback) {
90
+ return this.clients[lockID].getSignupChallenge(callback);
91
+ }
87
92
  }, {
88
93
  key: "getPasswordlessChallenge",
89
94
  value: function getPasswordlessChallenge(lockID, callback) {