auth0-lock 12.0.1 → 12.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.
@@ -4,7 +4,7 @@ orbs:
4
4
  executors:
5
5
  docker-executor:
6
6
  docker:
7
- - image: cimg/node:lts-browsers
7
+ - image: cimg/node:18.15-browsers
8
8
  jobs:
9
9
  build-and-test:
10
10
  executor: docker-executor
@@ -41,7 +41,7 @@ jobs:
41
41
  - store_artifacts:
42
42
  path: build
43
43
 
44
- browserstack:
44
+ e2e:
45
45
  executor: docker-executor
46
46
  environment:
47
47
  LANG: en_US.UTF-8
@@ -66,20 +66,18 @@ jobs:
66
66
  command: yarn build
67
67
  - run:
68
68
  name: Browser Tests
69
- command: yarn test:e2e:browserstack
69
+ command: yarn test:e2e
70
70
 
71
71
  workflows:
72
72
  build-test-report:
73
73
  jobs:
74
74
  - build-and-test
75
- - browserstack:
75
+ - e2e:
76
76
  requires:
77
77
  - build-and-test
78
- context:
79
- - browserstack-env
80
78
  - ship/node-publish:
81
79
  requires:
82
- - build-and-test
80
+ - e2e
83
81
  pkg-manager: yarn
84
82
  node-version: 18.12.1
85
83
  context:
@@ -0,0 +1,79 @@
1
+ name: 🐞 Report a bug
2
+ description: Have you found a bug or issue? Create a bug report for this library
3
+ labels: ["bug"]
4
+
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ **Please do not report security vulnerabilities here**. The [Responsible Disclosure Program](https://auth0.com/responsible-disclosure-policy) details the procedure for disclosing security issues.
10
+
11
+ - type: markdown
12
+ attributes:
13
+ value: |
14
+ :warning: **Note:** We are no longer supporting requests for new features. Only requests for bug fixes or security patches will be considered.
15
+
16
+ - type: checkboxes
17
+ id: checklist
18
+ attributes:
19
+ label: Checklist
20
+ options:
21
+ - label: I have looked into the [Readme](https://github.com/auth0/lock#readme) and [Examples](https://github.com/auth0/lock/blob/master/EXAMPLES.md), and have not found a suitable solution or answer.
22
+ required: true
23
+ - label: I have searched the [issues](https://github.com/auth0/lock/issues) and have not found a suitable solution or answer.
24
+ required: true
25
+ - label: I have searched the [Auth0 Community](https://community.auth0.com) forums and have not found a suitable solution or answer.
26
+ required: true
27
+ - label: I agree to the terms within the [Auth0 Code of Conduct](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md).
28
+ required: true
29
+
30
+ - type: textarea
31
+ id: description
32
+ attributes:
33
+ label: Description
34
+ description: Provide a clear and concise description of the issue, including what you expected to happen.
35
+ validations:
36
+ required: true
37
+
38
+ - type: textarea
39
+ id: reproduction
40
+ attributes:
41
+ label: Reproduction
42
+ description: Detail the steps taken to reproduce this error, and whether this issue can be reproduced consistently or if it is intermittent.
43
+ placeholder: |
44
+ 1. Step 1...
45
+ 2. Step 2...
46
+ 3. ...
47
+ validations:
48
+ required: true
49
+
50
+ - type: textarea
51
+ id: additional-context
52
+ attributes:
53
+ label: Additional context
54
+ description: Other libraries that might be involved, or any other relevant information you think would be useful.
55
+ validations:
56
+ required: false
57
+
58
+ - type: input
59
+ id: environment-version
60
+ attributes:
61
+ label: Lock version
62
+ validations:
63
+ required: true
64
+
65
+ - type: dropdown
66
+ id: environment-browser
67
+ attributes:
68
+ label: Which browsers have you tested in?
69
+ multiple: true
70
+ options:
71
+ - Chrome
72
+ - Edge
73
+ - Safari
74
+ - Firefox
75
+ - Opera
76
+ - IE
77
+ - Other
78
+ validations:
79
+ required: true
@@ -1,8 +1,8 @@
1
1
  blank_issues_enabled: false
2
2
  contact_links:
3
3
  - name: Auth0 Community
4
- url: https://community.auth0.com/c/sdks/5
4
+ url: https://community.auth0.com
5
5
  about: Discuss this SDK in the Auth0 Community forums
6
6
  - name: Library Documentation
7
- url: https://auth0.com/docs/libraries/lock/v11
7
+ url: https://auth0.com/docs/libraries/lock
8
8
  about: Read the library docs on Auth0.com
package/.semgrepignore ADDED
@@ -0,0 +1,7 @@
1
+ .circleci/
2
+ .github/
3
+ .vscode/
4
+ css/
5
+ examples/
6
+ support/
7
+ test/
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Change Log
2
2
 
3
+ ## [v12.1.0](https://github.com/auth0/lock/tree/v12.1.0) (2023-07-17)
4
+ [Full Changelog](https://github.com/auth0/lock/compare/v12.0.2...v12.1.0)
5
+
6
+ **Added**
7
+ - Added support for hCaptcha and Friendly Captcha [\#2387](https://github.com/auth0/lock/pull/2387) ([DominickBattistini](https://github.com/DominickBattistini))
8
+
9
+ **Changed**
10
+ - WelcomeMessage header text marked as heading [\#2373](https://github.com/auth0/lock/pull/2373) ([piwysocki](https://github.com/piwysocki))
11
+
12
+ ## [v12.0.2](https://github.com/auth0/lock/tree/v12.0.2) (2023-02-10)
13
+ [Full Changelog](https://github.com/auth0/lock/compare/v12.0.1...v12.0.2)
14
+
15
+ **Changed**
16
+ - Slight tweaks to Captcha input component handler methods + refresh button mask [\#2272](https://github.com/auth0/lock/pull/2272) ([stevehobbsdev](https://github.com/stevehobbsdev))
17
+
18
+ **Fixed**
19
+ - Fix for when component is undefined on unmount [\#2271](https://github.com/auth0/lock/pull/2271) ([codetheweb](https://github.com/codetheweb))
20
+
3
21
  ## [v12.0.1](https://github.com/auth0/lock/tree/v12.0.1) (2023-02-01)
4
22
  [Full Changelog](https://github.com/auth0/lock/compare/v12.0.0...v12.0.1)
5
23
 
package/EXAMPLES.md CHANGED
@@ -117,7 +117,7 @@ Lock will emit events during its lifecycle.
117
117
 
118
118
  Displays the widget, allowing you to override some options.
119
119
 
120
- - **options {Object}**: Allows you to customize some aspect of the dialog's appearance and behavior. The options allowed in here are a subset of the options allowed in the constructor and will override them: `allowedConnections`, `auth.params`, `allowLogin`, `allowSignUp`, `allowForgotPassword`, `initialScreen`, `rememberLastLogin`, `flashMessage` and `languageDictionary`. See [below](#customization) for the details. Keep in mind that `auth.params` will be fully replaced and not merged.
120
+ - **options {Object}**: Allows you to customize some aspect of the dialog's appearance and behavior. The options allowed in here are a subset of the options allowed in the constructor and will override them: `allowedConnections`, `auth.params`, `allowLogin`, `allowSignUp`, `allowForgotPassword`, `initialScreen`, `rememberLastLogin`, and `languageDictionary`. See [below](#customization) for the details. Keep in mind that `auth.params` will be fully replaced and not merged.
121
121
 
122
122
  #### Example
123
123
 
@@ -132,6 +132,22 @@ lock.show({ allowedConnections: ['twitter', 'facebook'] });
132
132
  lock.show({ auth: { params: { state: 'auth_state' } } });
133
133
  ```
134
134
 
135
+ #### Flash message
136
+
137
+ Configuration for `flashMessage` can be specified when using `show` to display a configurable message when Lock is opened. It contains the following properties:
138
+
139
+ - **type {String}**: The message type, it should be `error` or `success`.
140
+ - **text {String}**: The text to show.
141
+
142
+ ```js
143
+ lock.show({
144
+ flashMessage: {
145
+ type: 'error',
146
+ text: 'This is an error message'
147
+ }
148
+ }
149
+ ```
150
+
135
151
  ### resumeAuth(hash, callback)
136
152
 
137
153
  If you set the [auth.autoParseHash](#authentication-options) option to `false`, you'll need to call this method to complete the authentication flow. This method is useful when you're using a client-side router that uses a `#` to handle URLs (angular2 with `useHash` or react-router with `hashHistory`).
@@ -210,9 +226,6 @@ The appearance of the widget and the mechanics of authentication can be customiz
210
226
  - **closable {Boolean}**: Determines whether or not the Lock can be closed. When a `container` option is provided its value is always `false`, otherwise it defaults to `true`.
211
227
  - **popupOptions {Object}**: Allows you to customize the location of the popup in the screen. Any [position and size feature](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#Position_and_size_features) allowed by `window.open` is accepted. Defaults to `{}`.
212
228
  - **rememberLastLogin {Boolean}**: Determines whether or not to show a screen that allows you to quickly log in with the account you used the last time when the `initialScreen` option is set to `"login"` (the default). Defaults to `true`.
213
- - **flashMessage {Object}**: Shows an `error` or `success` flash message when Lock is shown.
214
- - **type {String}**: The message type, it should be `error` or `success`.
215
- - **text {String}**: The text to show.
216
229
  - **allowAutocomplete {Boolean}**: Determines whether or not the email or username inputs will allow autocomplete (`<input autocomplete />`). Defaults to `false`.
217
230
  - **scrollGlobalMessagesIntoView {Boolean}**: Determines whether or not a globalMessage should be scrolled into the user's viewport. Defaults to `true`.
218
231
  - **allowShowPassword {Boolean}**: Determines whether or not add a checkbox to show the password when typing it. Defaults to `false`.
@@ -648,4 +661,4 @@ var lock = new Auth0Lock(clientId, domain, options);
648
661
  lock.show();
649
662
  ```
650
663
 
651
- More information can be found in [Auth0's documentation](https://auth0.com/docs/libraries/lock/v11/authentication-modes#popup-mode).
664
+ More information can be found in [Auth0's documentation](https://auth0.com/docs/libraries/lock/v11/authentication-modes#popup-mode).
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.0.1/lock.min.js"></script>
33
+ <script src="https://cdn.auth0.com/js/lock/12.1.0/lock.min.js"></script>
34
34
  ```
35
35
  ### Configure Auth0
36
36
 
package/karma.conf.js CHANGED
@@ -118,6 +118,6 @@ module.exports = function (config) {
118
118
  }
119
119
  },
120
120
 
121
- browsers: ['bs_chrome_windows', 'bs_ie11_windows']
121
+ browsers: ['bs_chrome_windows']
122
122
  });
123
123
  };
@@ -58,7 +58,7 @@ describe('Login with connection scopes', function () {
58
58
  'sso-connection': ['offline_access']
59
59
  }
60
60
  }
61
- });
61
+ }, null, function () {});
62
62
  lock = (0, _index2.setField)(lock, 'email', 'test@test.com');
63
63
  require('store/index').read.mockReturnValue(lock);
64
64
  require('connection/enterprise').matchConnection.mockReturnValue(_immutable.default.fromJS({
@@ -73,7 +73,7 @@ describe('Login with connection scopes', function () {
73
73
  });
74
74
  });
75
75
  it('should not throw an error if the captcha was not completed', function () {
76
- lock = l.setup('__lock__', 'client', 'domain', {});
76
+ lock = l.setup('__lock__', 'client', 'domain', {}, null, function () {});
77
77
  lock = (0, _index2.setField)(lock, 'email', 'test@test.com');
78
78
 
79
79
  // This will be specified in the response from the /challenge endpoint if the
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+
3
+ var _react = _interopRequireDefault(require("react"));
4
+ var _enzyme = require("enzyme");
5
+ var _immutable = _interopRequireDefault(require("immutable"));
6
+ var _third_party_captcha = require("../../../field/captcha/third_party_captcha");
7
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
+ var createLockMock = function createLockMock() {
9
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
10
+ _ref$provider = _ref.provider,
11
+ provider = _ref$provider === void 0 ? 'none' : _ref$provider,
12
+ _ref$sitekey = _ref.sitekey,
13
+ sitekey = _ref$sitekey === void 0 ? '' : _ref$sitekey;
14
+ return _immutable.default.fromJS({
15
+ id: '__lock-id__',
16
+ core: {
17
+ captcha: {
18
+ provider: provider,
19
+ sitekey: sitekey
20
+ },
21
+ transient: {
22
+ ui: {
23
+ language: 'en-US'
24
+ }
25
+ }
26
+ }
27
+ });
28
+ };
29
+ describe('friendly captcha', function () {
30
+ it('should match the snapshot', function () {
31
+ var mockLock = createLockMock({
32
+ provider: 'friendly_captcha',
33
+ sitekey: 'mySiteKey'
34
+ });
35
+ var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_third_party_captcha.ThirdPartyCaptcha, {
36
+ provider: 'friendly_captcha',
37
+ lock: mockLock,
38
+ sitekey: 'mySiteKey'
39
+ }));
40
+ expect(wrapper).toMatchSnapshot();
41
+ });
42
+ describe('render', function () {
43
+ beforeAll(function () {
44
+ document.body.innerHTML = "<div id='renderTest'></div>";
45
+ });
46
+ afterAll(function () {
47
+ document.getElementById('renderTest').remove();
48
+ });
49
+ it('injects the script', function () {
50
+ _third_party_captcha.ThirdPartyCaptcha.loadScript({
51
+ hl: 'en-US',
52
+ provider: 'friendly_captcha'
53
+ }, document.body);
54
+ expect(document.body.innerHTML).toContain('<div id="renderTest">');
55
+ expect(document.body.innerHTML).toContain('<script src="https://cdn.jsdelivr.net/npm/friendly-challenge@0.9.12/widget.min.js');
56
+ });
57
+ });
58
+ });
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+
3
+ var _react = _interopRequireDefault(require("react"));
4
+ var _enzyme = require("enzyme");
5
+ var _immutable = _interopRequireDefault(require("immutable"));
6
+ var _third_party_captcha = require("../../../field/captcha/third_party_captcha");
7
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
+ var createLockMock = function createLockMock() {
9
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
10
+ _ref$provider = _ref.provider,
11
+ provider = _ref$provider === void 0 ? 'none' : _ref$provider,
12
+ _ref$sitekey = _ref.sitekey,
13
+ sitekey = _ref$sitekey === void 0 ? '' : _ref$sitekey;
14
+ return _immutable.default.fromJS({
15
+ id: '__lock-id__',
16
+ core: {
17
+ captcha: {
18
+ provider: provider,
19
+ sitekey: sitekey
20
+ },
21
+ transient: {
22
+ ui: {
23
+ language: 'en-US'
24
+ }
25
+ }
26
+ }
27
+ });
28
+ };
29
+ describe('hCaptcha', function () {
30
+ it('should match the snapshot', function () {
31
+ var mockLock = createLockMock({
32
+ provider: 'hcaptcha',
33
+ sitekey: 'mySiteKey'
34
+ });
35
+ var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_third_party_captcha.ThirdPartyCaptcha, {
36
+ provider: 'hcaptcha',
37
+ lock: mockLock,
38
+ sitekey: 'mySiteKey'
39
+ }));
40
+ expect(wrapper).toMatchSnapshot();
41
+ });
42
+ describe('render', function () {
43
+ beforeAll(function () {
44
+ document.body.innerHTML = "<div id='renderTest'></div>";
45
+ });
46
+ afterAll(function () {
47
+ document.getElementById('renderTest').remove();
48
+ });
49
+ it('injects the script', function () {
50
+ _third_party_captcha.ThirdPartyCaptcha.loadScript({
51
+ hl: 'en-US',
52
+ provider: 'hcaptcha'
53
+ }, document.body);
54
+ expect(document.body.innerHTML).toContain('<div id="renderTest">');
55
+ expect(document.body.innerHTML).toContain('<script src="https://js.hcaptcha.com/1/api.js?hl=en-US');
56
+ });
57
+ });
58
+ });
@@ -3,7 +3,7 @@
3
3
  var _react = _interopRequireDefault(require("react"));
4
4
  var _enzyme = require("enzyme");
5
5
  var _immutable = _interopRequireDefault(require("immutable"));
6
- var _recaptcha = require("../../../field/captcha/recaptcha");
6
+ var _third_party_captcha = require("../../../field/captcha/third_party_captcha");
7
7
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
8
  var createLockMock = function createLockMock() {
9
9
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
@@ -32,7 +32,7 @@ describe('Recaptcha Enterprise', function () {
32
32
  provider: 'recaptcha_enterprise',
33
33
  sitekey: 'mySiteKey'
34
34
  });
35
- var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_recaptcha.ReCAPTCHA, {
35
+ var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_third_party_captcha.ThirdPartyCaptcha, {
36
36
  provider: 'recaptcha_enterprise',
37
37
  lock: mockLock,
38
38
  sitekey: 'mySiteKey'
@@ -47,7 +47,7 @@ describe('Recaptcha Enterprise', function () {
47
47
  document.getElementById('renderTest').remove();
48
48
  });
49
49
  it('injects the script', function () {
50
- _recaptcha.ReCAPTCHA.loadScript({
50
+ _third_party_captcha.ThirdPartyCaptcha.loadScript({
51
51
  hl: 'en-US',
52
52
  provider: 'recaptcha_enterprise'
53
53
  }, document.body);
@@ -3,7 +3,7 @@
3
3
  var _react = _interopRequireDefault(require("react"));
4
4
  var _enzyme = require("enzyme");
5
5
  var _immutable = _interopRequireDefault(require("immutable"));
6
- var _recaptcha = require("../../../field/captcha/recaptcha");
6
+ var _third_party_captcha = require("../../../field/captcha/third_party_captcha");
7
7
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
8
  var createLockMock = function createLockMock() {
9
9
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
@@ -32,7 +32,7 @@ describe('Recaptcha v2', function () {
32
32
  provider: 'recaptcha_v2',
33
33
  sitekey: 'mySiteKey'
34
34
  });
35
- var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_recaptcha.ReCAPTCHA, {
35
+ var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_third_party_captcha.ThirdPartyCaptcha, {
36
36
  provider: 'recaptcha_v2',
37
37
  lock: mockLock,
38
38
  sitekey: 'mySiteKey'
@@ -47,7 +47,7 @@ describe('Recaptcha v2', function () {
47
47
  document.getElementById('renderTest').remove();
48
48
  });
49
49
  it('injects the script', function () {
50
- _recaptcha.ReCAPTCHA.loadScript({
50
+ _third_party_captcha.ThirdPartyCaptcha.loadScript({
51
51
  hl: 'en-US',
52
52
  provider: 'recaptcha_v2'
53
53
  }, document.body);
@@ -4,7 +4,7 @@ var _react = _interopRequireDefault(require("react"));
4
4
  var _enzyme = require("enzyme");
5
5
  var _immutable = _interopRequireDefault(require("immutable"));
6
6
  var _captcha_pane = _interopRequireDefault(require("../../field/captcha/captcha_pane"));
7
- var _recaptcha = require("../../field/captcha/recaptcha");
7
+ var _third_party_captcha = require("../../field/captcha/third_party_captcha");
8
8
  var _captcha_input = _interopRequireDefault(require("../../ui/input/captcha_input"));
9
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
10
  var createLockMock = function createLockMock() {
@@ -63,11 +63,55 @@ describe('CaptchaPane', function () {
63
63
  i18n: i8nMock
64
64
  }));
65
65
  });
66
- it('should render reCaptcha if provider is recaptchav2', function () {
67
- expect(wrapper.find(_recaptcha.ReCAPTCHA)).toHaveLength(1);
66
+ it('should render ThirdPartyCaptcha if provider is recaptchav2', function () {
67
+ expect(wrapper.find(_third_party_captcha.ThirdPartyCaptcha)).toHaveLength(1);
68
68
  });
69
69
  it('should pass the sitekey', function () {
70
- expect(wrapper.find(_recaptcha.ReCAPTCHA).props().sitekey).toBe('mySiteKey');
70
+ expect(wrapper.find(_third_party_captcha.ThirdPartyCaptcha).props().sitekey).toBe('mySiteKey');
71
+ });
72
+ });
73
+ describe('friendly captcha', function () {
74
+ var wrapper;
75
+ beforeAll(function () {
76
+ var lockMock = createLockMock({
77
+ provider: 'friendly_captcha',
78
+ siteKey: 'mySiteKey'
79
+ });
80
+ var i8nMock = createI18nMock();
81
+ var onReloadMock = jest.fn();
82
+ wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_captcha_pane.default, {
83
+ lock: lockMock,
84
+ onReload: onReloadMock,
85
+ i18n: i8nMock
86
+ }));
87
+ });
88
+ it('should render ThirdPartyCaptcha if provider is friendly captcha', function () {
89
+ expect(wrapper.find(_third_party_captcha.ThirdPartyCaptcha)).toHaveLength(1);
90
+ });
91
+ it('should pass the sitekey', function () {
92
+ expect(wrapper.find(_third_party_captcha.ThirdPartyCaptcha).props().sitekey).toBe('mySiteKey');
93
+ });
94
+ });
95
+ describe('hcaptcha', function () {
96
+ var wrapper;
97
+ beforeAll(function () {
98
+ var lockMock = createLockMock({
99
+ provider: 'hcaptcha',
100
+ siteKey: 'mySiteKey'
101
+ });
102
+ var i8nMock = createI18nMock();
103
+ var onReloadMock = jest.fn();
104
+ wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_captcha_pane.default, {
105
+ lock: lockMock,
106
+ onReload: onReloadMock,
107
+ i18n: i8nMock
108
+ }));
109
+ });
110
+ it('should render ThirdPartyCaptcha if provider is hCaptcha', function () {
111
+ expect(wrapper.find(_third_party_captcha.ThirdPartyCaptcha)).toHaveLength(1);
112
+ });
113
+ it('should pass the sitekey', function () {
114
+ expect(wrapper.find(_third_party_captcha.ThirdPartyCaptcha).props().sitekey).toBe('mySiteKey');
71
115
  });
72
116
  });
73
117
  describe('recaptcha enterprise', function () {
@@ -85,11 +129,11 @@ describe('CaptchaPane', function () {
85
129
  i18n: i8nMock
86
130
  }));
87
131
  });
88
- it('should render reCaptcha if provider is recaptcha_enterprise', function () {
89
- expect(wrapper.find(_recaptcha.ReCAPTCHA)).toHaveLength(1);
132
+ it('should render ThirdPartyCaptcha if provider is recaptcha_enterprise', function () {
133
+ expect(wrapper.find(_third_party_captcha.ThirdPartyCaptcha)).toHaveLength(1);
90
134
  });
91
135
  it('should pass the sitekey', function () {
92
- expect(wrapper.find(_recaptcha.ReCAPTCHA).props().sitekey).toBe('mySiteKey');
136
+ expect(wrapper.find(_third_party_captcha.ThirdPartyCaptcha).props().sitekey).toBe('mySiteKey');
93
137
  });
94
138
  });
95
139
  });
@@ -9,7 +9,7 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var _reactTestRenderer = _interopRequireDefault(require("react-test-renderer"));
10
10
  var _shallow = _interopRequireDefault(require("react-test-renderer/shallow"));
11
11
  var _webpack = require("webpack");
12
- var _excluded = ["children"];
12
+ var _excluded = ["children"]; // eslint-disable-line
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
14
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
15
15
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
package/lib/browser.js CHANGED
@@ -368,6 +368,15 @@ require("core-js/modules/web.url-search-params.js");
368
368
  var _index = _interopRequireDefault(require("./index"));
369
369
  var _passwordless = _interopRequireDefault(require("./passwordless"));
370
370
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
371
+ /*
372
+ *
373
+ * This is used to build the bundle with browserify.
374
+ *
375
+ * The bundle is used by people who doesn't use browserify.
376
+ * Those who use browserify will install with npm and require the module,
377
+ * the package.json file points to index.js.
378
+ */
379
+
371
380
  if (typeof window !== 'undefined') {
372
381
  if (typeof window.define == 'function' && window.define.amd) {
373
382
  window.define('auth0Lock', function () {
@@ -25,7 +25,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
25
25
  function showMissingCaptcha(m, id) {
26
26
  var isPasswordless = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
27
27
  var captchaConfig = isPasswordless ? l.passwordlessCaptcha(m) : l.captcha(m);
28
- var captchaError = captchaConfig.get('provider') === 'recaptcha_v2' || captchaConfig.get('provider') === 'recaptcha_enterprise' ? 'invalid_recaptcha' : 'invalid_captcha';
28
+ var captchaError = captchaConfig.get('provider') === 'recaptcha_v2' || captchaConfig.get('provider') === 'recaptcha_enterprise' || captchaConfig.get('provider') === 'hcaptcha' || captchaConfig.get('provider') === 'friendly_captcha' ? 'invalid_recaptcha' : 'invalid_captcha';
29
29
  var errorMessage = i18n.html(m, ['error', 'login', captchaError]);
30
30
  (0, _index3.swap)(_index3.updateEntity, 'lock', id, function (m) {
31
31
  m = l.setSubmitting(m, false, errorMessage);
@@ -21,7 +21,12 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
21
21
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
22
22
  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; }
23
23
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
24
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
24
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } // TODO: enterprise connections should not depend on database
25
+ // connections. However, we now allow a username input to contain also
26
+ // an email and this information is in the database module. We should
27
+ // make this information flow from the UI (like we do for the startHRD
28
+ // function). Including this dependency here allows us to do that
29
+ // incrementally.
25
30
  function startHRD(id, email) {
26
31
  (0, _index.swap)(_index.updateEntity, 'lock', id, _enterprise.toggleHRD, email);
27
32
  }
@@ -36,7 +36,7 @@ function getErrorMessage(m, id, error) {
36
36
  }
37
37
  if (error.code === 'invalid_captcha') {
38
38
  var captchaConfig = l.passwordlessCaptcha(m);
39
- key = captchaConfig.get('provider') === 'recaptcha_v2' || captchaConfig.get('provider') === 'recaptcha_enterprise' ? 'invalid_recaptcha' : 'invalid_captcha';
39
+ key = captchaConfig.get('provider') === 'recaptcha_v2' || captchaConfig.get('provider') === 'recaptcha_enterprise' || captchaConfig.get('provider') === 'hcaptcha' || captchaConfig.get('provider') === 'friendly_captcha' ? 'invalid_recaptcha' : 'invalid_captcha';
40
40
  }
41
41
  return i18n.html(m, ['error', 'passwordless', key]) || i18n.html(m, ['error', 'passwordless', 'lock.fallback']);
42
42
  }
@@ -26,7 +26,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
26
26
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
27
27
  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; }
28
28
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
29
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
29
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } // TODO: this module should depend from social stuff
30
30
  var _dataFns = (0, _data_utils.dataFns)(['client']),
31
31
  initNS = _dataFns.initNS,
32
32
  get = _dataFns.get;
package/lib/core/index.js CHANGED
@@ -655,7 +655,7 @@ function loginErrorMessage(m, error, type) {
655
655
  }
656
656
  if (code === 'invalid_captcha') {
657
657
  var currentCaptcha = get(m, 'captcha');
658
- if (currentCaptcha && (currentCaptcha.get('provider') === 'recaptcha_v2' || currentCaptcha.get('provider') === 'recaptcha_enterprise')) {
658
+ if (currentCaptcha && (currentCaptcha.get('provider') === 'recaptcha_v2' || currentCaptcha.get('provider') === 'recaptcha_enterprise' || currentCaptcha.get('provider') === 'hcaptcha' || captchaConfig.get('provider') === 'friendly_captcha')) {
659
659
  code = 'invalid_recaptcha';
660
660
  }
661
661
  }
@@ -170,5 +170,5 @@ function trimAuthParams() {
170
170
  return p;
171
171
  }
172
172
  function getVersion() {
173
- return "12.0.1";
173
+ return "12.1.0";
174
174
  }