auth0-lock 11.31.0 → 11.32.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,12 +1,57 @@
1
1
  # Change Log
2
2
 
3
+ ## [v11.32.2](https://github.com/auth0/lock/tree/v11.32.2) (2022-02-08)
4
+ [Full Changelog](https://github.com/auth0/lock/compare/v11.32.1...v11.32.2)
5
+
6
+ **Changed**
7
+ - align german loginWithLabel translation with Apple Guidelines [\#2097](https://github.com/auth0/lock/pull/2097) ([Steffen911](https://github.com/Steffen911))
8
+
9
+ **Fixed**
10
+ - [SDK-3087] Captcha for single enterprise AD connections [\#2096](https://github.com/auth0/lock/pull/2096) ([stevehobbsdev](https://github.com/stevehobbsdev))
11
+
12
+ **Security**
13
+ - [Snyk] Upgrade qs from 6.10.2 to 6.10.3 [\#2095](https://github.com/auth0/lock/pull/2095) ([snyk-bot](https://github.com/snyk-bot))
14
+ - Bump cached-path-relative from 1.0.2 to 1.1.0 [\#2091](https://github.com/auth0/lock/pull/2091) ([dependabot[bot]](https://github.com/apps/dependabot))
15
+
16
+ ## [v11.32.1](https://github.com/auth0/lock/tree/v11.32.1) (2022-01-27)
17
+ [Full Changelog](https://github.com/auth0/lock/compare/v11.32.0...v11.32.1)
18
+
19
+ **Changed**
20
+ - Update auth0-js and support legacySameSiteCookie option [\#2089](https://github.com/auth0/lock/pull/2089) ([stevehobbsdev](https://github.com/stevehobbsdev))
21
+
22
+ **Security**
23
+ - Bump log4js from 6.3.0 to 6.4.0 [\#2087](https://github.com/auth0/lock/pull/2087) ([dependabot[bot]](https://github.com/apps/dependabot))
24
+ - Security upgrade node-fetch to 2.6.7 [\#2085](https://github.com/auth0/lock/pull/2085) ([evansims](https://github.com/evansims))
25
+ - [Snyk] Upgrade prop-types from 15.7.2 to 15.8.0 [\#2083](https://github.com/auth0/lock/pull/2083) ([snyk-bot](https://github.com/snyk-bot))
26
+ - Bump engine.io from 4.1.1 to 4.1.2 [\#2082](https://github.com/auth0/lock/pull/2082) ([dependabot[bot]](https://github.com/apps/dependabot))
27
+ - Bump follow-redirects from 1.14.4 to 1.14.7 [\#2081](https://github.com/auth0/lock/pull/2081) ([dependabot[bot]](https://github.com/apps/dependabot))
28
+
29
+ ## [v11.32.0](https://github.com/auth0/lock/tree/v11.32.0) (2022-01-07)
30
+ [Full Changelog](https://github.com/auth0/lock/compare/v11.31.1...v11.32.0)
31
+
32
+ **Fixed**
33
+ - [SDK-2970] Remove captcha for enterprise SSO connections [\#2071](https://github.com/auth0/lock/pull/2071) ([stevehobbsdev](https://github.com/stevehobbsdev))
34
+ - Add ID attributes to password field + submit button [\#2072](https://github.com/auth0/lock/pull/2072) ([stevehobbsdev](https://github.com/stevehobbsdev))
35
+
36
+ ## [v11.31.1](https://github.com/auth0/lock/tree/v11.31.1) (2021-11-02)
37
+
38
+ [Full Changelog](https://github.com/auth0/lock/compare/v11.31.0...v11.31.1)
39
+
40
+ **Fixed**
41
+
42
+ - Guard references to window on module load [\#2057](https://github.com/auth0/lock/pull/2057) ([stevehobbsdev](https://github.com/stevehobbsdev))
43
+ - Ensure Captcha is completed before authenticating with enterprise SSO connection [\#2060](https://github.com/auth0/lock/pull/2060) ([stevehobbsdev](https://github.com/stevehobbsdev))
44
+
3
45
  ## [v11.31.0](https://github.com/auth0/lock/tree/v11.31.0) (2021-10-15)
46
+
4
47
  [Full Changelog](https://github.com/auth0/lock/compare/v11.30.6...v11.31.0)
5
48
 
6
49
  **Added**
50
+
7
51
  - [SDK-2295] Add forceAutoHeight property to UI config [\#2050](https://github.com/auth0/lock/pull/2050) ([stevehobbsdev](https://github.com/stevehobbsdev))
8
52
 
9
53
  **Fixed**
54
+
10
55
  - [SDK-2823] Fix password reset when using custom connection resolver [\#2048](https://github.com/auth0/lock/pull/2048) ([stevehobbsdev](https://github.com/stevehobbsdev))
11
56
 
12
57
  ## [v11.30.6](https://github.com/auth0/lock/tree/v11.30.6) (2021-09-27)
package/README.md CHANGED
@@ -25,7 +25,7 @@ From CDN
25
25
 
26
26
  ```html
27
27
  <!-- Latest patch release (recommended for production) -->
28
- <script src="https://cdn.auth0.com/js/lock/11.31.0/lock.min.js"></script>
28
+ <script src="https://cdn.auth0.com/js/lock/11.32.2/lock.min.js"></script>
29
29
  ```
30
30
 
31
31
  From [npm](https://npmjs.org)
@@ -415,14 +415,15 @@ Specify your hooks using a new `hooks` configuration item when setting up the li
415
415
  ```js
416
416
  new Auth0Lock('client ID', 'domain', {
417
417
  hooks: {
418
- loggingIn: function(context, cb) {
418
+ loggingIn: function (context, cb) {
419
419
  console.log('Hello from the login hook!');
420
420
  cb();
421
421
  },
422
- signingUp: function(context, cb) {
422
+ signingUp: function (context, cb) {
423
423
  console.log('Hello from the sign-up hook!');
424
424
  cb();
425
425
  }
426
+ }
426
427
  });
427
428
  ```
428
429
 
@@ -433,13 +434,14 @@ The developer can throw an error to block the login or sign-up process. The deve
433
434
  ```js
434
435
  new Auth0Lock('client ID', 'domain', {
435
436
  hooks: {
436
- loggingIn: function(context, cb) {
437
+ loggingIn: function (context, cb) {
437
438
  // Throw an object with code: `hook_error` to display this on the Login screen
438
439
  throw { code: 'hook_error', description: 'There was an error in the login hook!' };
439
440
 
440
441
  // Throw something generic to show a fallback error message
441
- throw "Some error happened";
442
- },
442
+ throw 'Some error happened';
443
+ }
444
+ }
443
445
  });
444
446
  ```
445
447
 
@@ -451,6 +453,7 @@ new Auth0Lock('client ID', 'domain', {
451
453
  - **languageBaseUrl {String}**: Overrides the language source URL for Auth0's provided translations. By default it uses to Auth0's CDN URL `https://cdn.auth0.com`.
452
454
  - **hashCleanup {Boolean}**: When enabled, it will remove the hash part of the callback URL after the user authentication. Defaults to `true`.
453
455
  - **connectionResolver {Function}**: When in use, provides an extensibility point to make it possible to choose which connection to use based on the username information. Has `username`, `context`, and `callback` as parameters. The callback expects an object like: `{type: 'database', name: 'connection name'}`. **This only works for database connections.** Keep in mind that this resolver will run in the form's `onSubmit` event, so keep it simple and fast. **This is a beta feature. If you find a bug, please open a GitHub [issue](https://github.com/auth0/lock/issues/new).**
456
+ - **legacySameSiteCookie**: If `false`, no compatibility cookies will be created for those browsers that do not understand the `SameSite` attribute. Defaults to `true`
454
457
 
455
458
  ```js
456
459
  var options = {
package/karma.conf.js CHANGED
@@ -1,4 +1,4 @@
1
- module.exports = function(config) {
1
+ module.exports = function (config) {
2
2
  process.env.CHROME_BIN = require('puppeteer').executablePath();
3
3
 
4
4
  config.set({
@@ -52,9 +52,9 @@ module.exports = function(config) {
52
52
 
53
53
  browserNoActivityTimeout: 60000,
54
54
 
55
- browserDisconnectTimeout: 20000,
55
+ browserDisconnectTimeout: 30000,
56
56
 
57
- browserDisconnectTolerance: 3,
57
+ browserDisconnectTolerance: 10,
58
58
 
59
59
  // level of logging
60
60
  logLevel: config.LOG_INFO,
@@ -118,12 +118,6 @@ module.exports = function(config) {
118
118
  }
119
119
  },
120
120
 
121
- browsers: [
122
- 'bs_chrome_windows',
123
- 'bs_firefox_windows',
124
- 'bs_safari',
125
- 'bs_ie11_windows',
126
- 'bs_edge_windows'
127
- ]
121
+ browsers: ['bs_chrome_windows']
128
122
  });
129
123
  };
@@ -0,0 +1,93 @@
1
+ 'use strict';
2
+
3
+ var _react = require('react');
4
+
5
+ var _react2 = _interopRequireDefault(_react);
6
+
7
+ var _immutable = require('immutable');
8
+
9
+ var _immutable2 = _interopRequireDefault(_immutable);
10
+
11
+ var _testUtils = require('testUtils');
12
+
13
+ var _login_pane = require('../../../connection/database/login_pane');
14
+
15
+ var _login_pane2 = _interopRequireDefault(_login_pane);
16
+
17
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
+
19
+ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
20
+
21
+ var lock = _immutable2.default.fromJS({ id: '__lock-id__' });
22
+
23
+ jest.mock('core/index');
24
+
25
+ jest.mock('engine/classic');
26
+ jest.mock('connection/enterprise');
27
+
28
+ describe('LoginPane', function () {
29
+ var defaultProps = {
30
+ emailInputPlaceholder: '',
31
+ forgotPasswordAction: '',
32
+ i18n: {},
33
+ passwordInputPlaceholder: '',
34
+ showForgotPasswordLink: true,
35
+ showPassword: true,
36
+ usernameInputPlaceholder: '',
37
+ lock: lock
38
+ };
39
+
40
+ beforeEach(function () {
41
+ jest.resetAllMocks();
42
+ });
43
+
44
+ it('renders correctly', _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
45
+ return regeneratorRuntime.wrap(function _callee$(_context) {
46
+ while (1) {
47
+ switch (_context.prev = _context.next) {
48
+ case 0:
49
+ (0, _testUtils.expectShallowComponent)(_react2.default.createElement(_login_pane2.default, defaultProps)).toMatchSnapshot();
50
+
51
+ case 1:
52
+ case 'end':
53
+ return _context.stop();
54
+ }
55
+ }
56
+ }, _callee, undefined);
57
+ })));
58
+
59
+ it('renders a captcha', function () {
60
+ require('core/index').captcha.mockReturnValue({
61
+ get: function get() {
62
+ return true;
63
+ }
64
+ });
65
+
66
+ (0, _testUtils.expectShallowComponent)(_react2.default.createElement(_login_pane2.default, defaultProps)).toMatchSnapshot();
67
+ });
68
+
69
+ it('hides the captcha for SSO connections', function () {
70
+ require('core/index').captcha.mockReturnValue({
71
+ get: function get() {
72
+ return true;
73
+ }
74
+ });
75
+
76
+ require('engine/classic').isSSOEnabled.mockReturnValue(true);
77
+
78
+ (0, _testUtils.expectShallowComponent)(_react2.default.createElement(_login_pane2.default, defaultProps)).toMatchSnapshot();
79
+ });
80
+
81
+ it('shows the captcha for SSO (ADFS) connections', function () {
82
+ require('core/index').captcha.mockReturnValue({
83
+ get: function get() {
84
+ return true;
85
+ }
86
+ });
87
+
88
+ require('engine/classic').isSSOEnabled.mockReturnValue(true);
89
+ require('connection/enterprise').isHRDDomain.mockReturnValue(true);
90
+
91
+ (0, _testUtils.expectShallowComponent)(_react2.default.createElement(_login_pane2.default, defaultProps)).toMatchSnapshot();
92
+ });
93
+ });
@@ -20,7 +20,8 @@ jest.mock('connection/database/index', function () {
20
20
  return {
21
21
  databaseLogInWithEmail: jest.fn(function () {
22
22
  return true;
23
- })
23
+ }),
24
+ databaseUsernameValue: jest.fn()
24
25
  };
25
26
  });
26
27
 
@@ -39,7 +40,8 @@ jest.mock('connection/enterprise', function () {
39
40
  return {
40
41
  matchConnection: jest.fn(),
41
42
  enterpriseActiveFlowConnection: jest.fn(),
42
- isHRDActive: jest.fn()
43
+ isHRDActive: jest.fn(),
44
+ isEnterpriseDomain: jest.fn()
43
45
  };
44
46
  });
45
47
 
@@ -87,6 +89,27 @@ describe('Login with connection scopes', function () {
87
89
  login_hint: 'test@test.com'
88
90
  });
89
91
  });
92
+
93
+ it('should not throw an error if the captcha was not completed', function () {
94
+ lock = l.setup('__lock__', 'client', 'domain', {});
95
+ lock = (0, _index2.setField)(lock, 'email', 'test@test.com');
96
+
97
+ // This will be specified in the response from the /challenge endpoint if the
98
+ // dashboard settings have Captcha as 'required', regardless of connection being used.
99
+ lock = l.setCaptcha(lock, {
100
+ required: true,
101
+ provider: 'recaptcha_v2'
102
+ });
103
+
104
+ require('store/index').read.mockReturnValue(lock);
105
+
106
+ require('connection/enterprise').matchConnection.mockReturnValue(_immutable2.default.fromJS({ name: 'sso-connection' }));
107
+
108
+ var coreActions = require('core/actions');
109
+
110
+ (0, _actions.logIn)('__lock__');
111
+ expect(coreActions.logIn).toHaveBeenCalled();
112
+ });
90
113
  });
91
114
 
92
115
  describe('for a non-SSO connection', function () {
@@ -116,7 +139,7 @@ describe('Login with connection scopes', function () {
116
139
  username: 'test',
117
140
  password: 'test',
118
141
  login_hint: 'test'
119
- });
142
+ }, expect.any(Function));
120
143
  });
121
144
  });
122
145
  });
@@ -0,0 +1,55 @@
1
+ 'use strict';
2
+
3
+ var _react = require('react');
4
+
5
+ var _react2 = _interopRequireDefault(_react);
6
+
7
+ var _testUtils = require('testUtils');
8
+
9
+ var _immutable = require('immutable');
10
+
11
+ var _immutable2 = _interopRequireDefault(_immutable);
12
+
13
+ var _i18n = require('../../../i18n');
14
+
15
+ var i18n = _interopRequireWildcard(_i18n);
16
+
17
+ var _hrd_pane = require('../../../connection/enterprise/hrd_pane');
18
+
19
+ var _hrd_pane2 = _interopRequireDefault(_hrd_pane);
20
+
21
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
22
+
23
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24
+
25
+ var lock = _immutable2.default.fromJS({ id: '__lock-id__' });
26
+
27
+ jest.mock('core/index');
28
+
29
+ describe('HRDPane', function () {
30
+ var defaultProps = {
31
+ model: lock,
32
+ header: _react2.default.createElement('header', null),
33
+ i18n: i18n,
34
+ passwordInputPlaceholder: 'password',
35
+ usernameInputPlaceholder: 'username'
36
+ };
37
+
38
+ beforeEach(function () {
39
+ jest.resetAllMocks();
40
+ });
41
+
42
+ it('renders correctly', function () {
43
+ (0, _testUtils.expectShallowComponent)(_react2.default.createElement(_hrd_pane2.default, defaultProps)).toMatchSnapshot();
44
+ });
45
+
46
+ it('renders the captcha if required', function () {
47
+ require('core/index').captcha.mockReturnValue({
48
+ get: function get() {
49
+ return true;
50
+ }
51
+ });
52
+
53
+ (0, _testUtils.expectShallowComponent)(_react2.default.createElement(_hrd_pane2.default, defaultProps)).toMatchSnapshot();
54
+ });
55
+ });
@@ -4,8 +4,6 @@ var _react = require('react');
4
4
 
5
5
  var _react2 = _interopRequireDefault(_react);
6
6
 
7
- var _enzyme = require('enzyme');
8
-
9
7
  var _testUtils = require('testUtils');
10
8
 
11
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -6,10 +6,10 @@ var _react = require('react');
6
6
 
7
7
  var _react2 = _interopRequireDefault(_react);
8
8
 
9
- var _enzyme = require('enzyme');
10
-
11
9
  var _testUtils = require('testUtils');
12
10
 
11
+ var _testUtils2 = require('../../testUtils');
12
+
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
14
 
15
15
  jest.mock('field/email/email_pane', function () {
@@ -25,6 +25,24 @@ jest.mock('field/custom_input', function () {
25
25
  return (0, _testUtils.mockComponent)('custom_input');
26
26
  });
27
27
 
28
+ jest.mock('core/index', function () {
29
+ return {
30
+ captcha: jest.fn()
31
+ };
32
+ });
33
+
34
+ jest.mock('engine/classic', function () {
35
+ return {
36
+ isSSOEnabled: jest.fn()
37
+ };
38
+ });
39
+
40
+ jest.mock('connection/enterprise', function () {
41
+ return {
42
+ isHRDDomain: jest.fn()
43
+ };
44
+ });
45
+
28
46
  var getComponent = function getComponent() {
29
47
  return require('engine/classic/sign_up_pane').default;
30
48
  };
@@ -46,6 +64,9 @@ describe('SignUpPane', function () {
46
64
  },
47
65
  signUpFieldsStrictValidation: function signUpFieldsStrictValidation() {
48
66
  return true;
67
+ },
68
+ databaseUsernameValue: function databaseUsernameValue() {
69
+ return null;
49
70
  }
50
71
  };
51
72
  });
@@ -85,6 +106,50 @@ describe('SignUpPane', function () {
85
106
 
86
107
  (0, _testUtils.expectComponent)(_react2.default.createElement(Component, _extends({}, defaultProps, { instructions: 'instructions' }))).toMatchSnapshot();
87
108
  });
109
+
110
+ it('shows the Captcha pane', function () {
111
+ require('core/index').captcha.mockReturnValue({
112
+ get: function get() {
113
+ return true;
114
+ }
115
+ });
116
+
117
+ require('engine/classic').isSSOEnabled.mockReturnValue(false);
118
+
119
+ var Component = getComponent();
120
+
121
+ (0, _testUtils2.expectShallowComponent)(_react2.default.createElement(Component, defaultProps)).toMatchSnapshot();
122
+ });
123
+
124
+ it('hides the Captcha pane for SSO connections', function () {
125
+ require('core/index').captcha.mockReturnValue({
126
+ get: function get() {
127
+ return true;
128
+ }
129
+ });
130
+
131
+ require('engine/classic').isSSOEnabled.mockReturnValue(true);
132
+
133
+ var Component = getComponent();
134
+
135
+ (0, _testUtils2.expectShallowComponent)(_react2.default.createElement(Component, defaultProps)).toMatchSnapshot();
136
+ });
137
+
138
+ it('shows the Captcha pane for SSO (ADFS) connections', function () {
139
+ require('core/index').captcha.mockReturnValue({
140
+ get: function get() {
141
+ return true;
142
+ }
143
+ });
144
+
145
+ require('engine/classic').isSSOEnabled.mockReturnValue(true);
146
+ require('connection/enterprise').isHRDDomain.mockReturnValue(true);
147
+
148
+ var Component = getComponent();
149
+
150
+ (0, _testUtils2.expectShallowComponent)(_react2.default.createElement(Component, defaultProps)).toMatchSnapshot();
151
+ });
152
+
88
153
  describe('onlyEmail is false', function () {
89
154
  it('shows PasswordPane', function () {
90
155
  var Component = getComponent();
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  exports.__esModule = true;
4
- exports.expectMockToMatch = exports.setURL = exports.extractPropsFromWrapper = exports.mockComponent = exports.expectComponent = undefined;
4
+ exports.expectMockToMatch = exports.setURL = exports.extractPropsFromWrapper = exports.mockComponent = exports.renderShallowComponent = exports.expectShallowComponent = exports.expectComponent = undefined;
5
5
 
6
6
  var _extends = Object.assign || 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; };
7
7
 
@@ -13,6 +13,10 @@ var _reactTestRenderer = require('react-test-renderer');
13
13
 
14
14
  var _reactTestRenderer2 = _interopRequireDefault(_reactTestRenderer);
15
15
 
16
+ var _shallow = require('react-test-renderer/shallow');
17
+
18
+ var _shallow2 = _interopRequireDefault(_shallow);
19
+
16
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
21
 
18
22
  function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } // eslint-disable-line
@@ -23,6 +27,18 @@ var expectComponent = exports.expectComponent = function expectComponent(childre
23
27
  return expect(component);
24
28
  };
25
29
 
30
+ var expectShallowComponent = exports.expectShallowComponent = function expectShallowComponent(children) {
31
+ var component = renderShallowComponent(children);
32
+ return expect(component);
33
+ };
34
+
35
+ var renderShallowComponent = exports.renderShallowComponent = function renderShallowComponent(children) {
36
+ var renderer = new _shallow2.default();
37
+
38
+ renderer.render(children);
39
+ return renderer.getRenderOutput();
40
+ };
41
+
26
42
  var addDataToProps = function addDataToProps(props) {
27
43
  var returnedProps = {};
28
44
  Object.keys(props).forEach(function (k) {
@@ -45,7 +45,10 @@ jest.mock('core/index', function () {
45
45
  }),
46
46
  ui: {
47
47
  forceAutoHeight: jest.fn().mockReturnValue(false)
48
- }
48
+ },
49
+ id: jest.fn(function () {
50
+ return 'lock';
51
+ })
49
52
  };
50
53
  });
51
54
 
@@ -29,7 +29,10 @@ jest.mock('core/index', function () {
29
29
  allowPasswordAutocomplete: function allowPasswordAutocomplete() {
30
30
  return false;
31
31
  }
32
- }
32
+ },
33
+ id: jest.fn(function () {
34
+ return 'lock';
35
+ })
33
36
  };
34
37
  });
35
38
 
package/lib/browser.js CHANGED
@@ -19,14 +19,16 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
19
19
  * the package.json file points to index.js.
20
20
  */
21
21
 
22
- if (typeof window.define == 'function' && window.define.amd) {
23
- window.define('auth0Lock', function () {
24
- return _index2.default;
25
- });
26
- window.define('auth0LockPasswordless', function () {
27
- return _passwordless2.default;
28
- });
29
- } else if (window.window) {
30
- window.Auth0Lock = _index2.default;
31
- window.Auth0LockPasswordless = _passwordless2.default;
22
+ if (typeof window !== 'undefined') {
23
+ if (typeof window.define == 'function' && window.define.amd) {
24
+ window.define('auth0Lock', function () {
25
+ return _index2.default;
26
+ });
27
+ window.define('auth0LockPasswordless', function () {
28
+ return _passwordless2.default;
29
+ });
30
+ } else if (window.window) {
31
+ window.Auth0Lock = _index2.default;
32
+ window.Auth0LockPasswordless = _passwordless2.default;
33
+ }
32
34
  }
@@ -0,0 +1,94 @@
1
+ 'use strict';
2
+
3
+ exports.__esModule = true;
4
+ exports.showMissingCaptcha = showMissingCaptcha;
5
+ exports.setCaptchaParams = setCaptchaParams;
6
+ exports.swapCaptcha = swapCaptcha;
7
+
8
+ var _index = require('../core/index');
9
+
10
+ var l = _interopRequireWildcard(_index);
11
+
12
+ var _index2 = require('../field/index');
13
+
14
+ var c = _interopRequireWildcard(_index2);
15
+
16
+ var _i18n = require('../i18n');
17
+
18
+ var i18n = _interopRequireWildcard(_i18n);
19
+
20
+ var _index3 = require('../store/index');
21
+
22
+ var _web_api = require('../core/web_api');
23
+
24
+ var _web_api2 = _interopRequireDefault(_web_api);
25
+
26
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
+
28
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
29
+
30
+ /**
31
+ * Display the error message of missing captcha in the header of lock.
32
+ *
33
+ * @param {Object} m model
34
+ * @param {Number} id
35
+ */
36
+ function showMissingCaptcha(m, id) {
37
+ var captchaConfig = l.captcha(m);
38
+
39
+ var captchaError = captchaConfig.get('provider') === 'recaptcha_v2' ? 'invalid_recaptcha' : 'invalid_captcha';
40
+
41
+ var errorMessage = i18n.html(m, ['error', 'login', captchaError]);
42
+
43
+ (0, _index3.swap)(_index3.updateEntity, 'lock', id, function (m) {
44
+ m = l.setSubmitting(m, false, errorMessage);
45
+ return c.showInvalidField(m, 'captcha');
46
+ });
47
+
48
+ return m;
49
+ }
50
+
51
+ /**
52
+ * Set the captcha value in the fields object before sending the request.
53
+ *
54
+ * @param {Object} m model
55
+ * @param {Object} params
56
+ * @param {Object} fields
57
+ *
58
+ * @returns {Boolean} returns true if is required and missing the response from the user
59
+ */
60
+ function setCaptchaParams(m, params, fields) {
61
+ var captchaConfig = l.captcha(m);
62
+ var isCaptchaRequired = captchaConfig && l.captcha(m).get('required');
63
+
64
+ if (!isCaptchaRequired) {
65
+ return true;
66
+ }
67
+ var captcha = c.getFieldValue(m, 'captcha');
68
+ //captcha required and missing
69
+ if (!captcha) {
70
+ return false;
71
+ }
72
+
73
+ params['captcha'] = captcha;
74
+ fields.push('captcha');
75
+ return true;
76
+ }
77
+
78
+ /**
79
+ * Get a new challenge and display the new captcha image.
80
+ *
81
+ * @param {number} id The id of the Lock instance.
82
+ * @param {boolean} wasInvalid A boolean indicating if the previous captcha was invalid.
83
+ * @param {Function} [next] A callback.
84
+ */
85
+ function swapCaptcha(id, wasInvalid, next) {
86
+ return _web_api2.default.getChallenge(id, function (err, newCaptcha) {
87
+ if (!err && newCaptcha) {
88
+ (0, _index3.swap)(_index3.updateEntity, 'lock', id, l.setCaptcha, newCaptcha, wasInvalid);
89
+ }
90
+ if (next) {
91
+ next();
92
+ }
93
+ });
94
+ }
@@ -12,7 +12,6 @@ exports.cancelResetPassword = cancelResetPassword;
12
12
  exports.cancelMFALogin = cancelMFALogin;
13
13
  exports.toggleTermsAcceptance = toggleTermsAcceptance;
14
14
  exports.showLoginMFAActivity = showLoginMFAActivity;
15
- exports.swapCaptcha = swapCaptcha;
16
15
 
17
16
  var _immutable = require('immutable');
18
17
 
@@ -40,6 +39,8 @@ var _i18n = require('../../i18n');
40
39
 
41
40
  var i18n = _interopRequireWildcard(_i18n);
42
41
 
42
+ var _captcha = require('../captcha');
43
+
43
44
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
44
45
 
45
46
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -50,6 +51,7 @@ function logIn(id) {
50
51
  var m = (0, _index.read)(_index.getEntity, 'lock', id);
51
52
  var usernameField = (0, _index4.databaseLogInWithEmail)(m) ? 'email' : 'username';
52
53
  var username = c.getFieldValue(m, usernameField);
54
+
53
55
  var params = {
54
56
  connection: (0, _index4.databaseConnectionName)(m),
55
57
  username: username,
@@ -57,13 +59,14 @@ function logIn(id) {
57
59
  };
58
60
 
59
61
  var fields = [usernameField, 'password'];
62
+ var isCaptchaValid = (0, _captcha.setCaptchaParams)(m, params, fields);
60
63
 
61
- var isCaptchaValid = setCaptchaParams(m, params, fields);
62
64
  if (!isCaptchaValid) {
63
- return showMissingCaptcha(m, id);
65
+ return (0, _captcha.showMissingCaptcha)(m, id);
64
66
  }
65
67
 
66
68
  var mfaCode = c.getFieldValue(m, 'mfa_code');
69
+
67
70
  if (needsMFA) {
68
71
  params['mfa_code'] = mfaCode;
69
72
  fields.push('mfa_code');
@@ -76,7 +79,7 @@ function logIn(id) {
76
79
 
77
80
  if (error) {
78
81
  var wasInvalid = error && error.code === 'invalid_captcha';
79
- return swapCaptcha(id, wasInvalid, next);
82
+ return (0, _captcha.swapCaptcha)(id, wasInvalid, next);
80
83
  }
81
84
 
82
85
  next();
@@ -113,9 +116,9 @@ function signUp(id) {
113
116
  autoLogin: (0, _index4.shouldAutoLogin)(m)
114
117
  };
115
118
 
116
- var isCaptchaValid = setCaptchaParams(m, params, fields);
119
+ var isCaptchaValid = (0, _captcha.setCaptchaParams)(m, params, fields);
117
120
  if (!isCaptchaValid) {
118
- return showMissingCaptcha(m, id);
121
+ return (0, _captcha.showMissingCaptcha)(m, id);
119
122
  }
120
123
 
121
124
  if ((0, _index4.databaseConnectionRequiresUsername)(m)) {
@@ -155,7 +158,7 @@ function signUp(id) {
155
158
 
156
159
  var wasInvalidCaptcha = error && error.code === 'invalid_captcha';
157
160
 
158
- swapCaptcha(id, wasInvalidCaptcha, function () {
161
+ (0, _captcha.swapCaptcha)(id, wasInvalidCaptcha, function () {
159
162
  setTimeout(function () {
160
163
  return signUpError(id, error);
161
164
  }, 250);
@@ -255,7 +258,7 @@ function signUpError(id, error) {
255
258
 
256
259
  if (errorKey === 'invalid_captcha') {
257
260
  errorMessage = i18n.html(m, ['error', 'login', errorKey]);
258
- return swapCaptcha(id, true, function () {
261
+ return (0, _captcha.swapCaptcha)(id, true, function () {
259
262
  (0, _index.swap)(_index.updateEntity, 'lock', id, l.setSubmitting, false, errorMessage);
260
263
  });
261
264
  }
@@ -360,64 +363,3 @@ function showLoginMFAActivity(id) {
360
363
 
361
364
  (0, _index.swap)(_index.updateEntity, 'lock', id, _index4.setScreen, 'mfaLogin', fields);
362
365
  }
363
-
364
- /**
365
- * Get a new challenge and display the new captcha image.
366
- *
367
- * @param {number} id The id of the Lock instance.
368
- * @param {boolean} wasInvalid A boolean indicating if the previous captcha was invalid.
369
- * @param {Function} [next] A callback.
370
- */
371
- function swapCaptcha(id, wasInvalid, next) {
372
- return _web_api2.default.getChallenge(id, function (err, newCaptcha) {
373
- if (!err && newCaptcha) {
374
- (0, _index.swap)(_index.updateEntity, 'lock', id, l.setCaptcha, newCaptcha, wasInvalid);
375
- }
376
- if (next) {
377
- next();
378
- }
379
- });
380
- }
381
-
382
- /**
383
- * Display the error message of missing captcha in the header of lock.
384
- *
385
- * @param {Object} m model
386
- * @param {Number} id
387
- */
388
- function showMissingCaptcha(m, id) {
389
- var captchaConfig = l.captcha(m);
390
- var captchaError = captchaConfig.get('provider') === 'recaptcha_v2' ? 'invalid_recaptcha' : 'invalid_captcha';
391
- var errorMessage = i18n.html(m, ['error', 'login', captchaError]);
392
- (0, _index.swap)(_index.updateEntity, 'lock', id, function (m) {
393
- m = l.setSubmitting(m, false, errorMessage);
394
- return c.showInvalidField(m, 'captcha');
395
- });
396
- return m;
397
- }
398
-
399
- /**
400
- * Set the captcha value in the fields object before sending the request.
401
- *
402
- * @param {Object} m model
403
- * @param {Object} params
404
- * @param {Object} fields
405
- *
406
- * @returns {Boolean} returns true if is required and missing the response from the user
407
- */
408
- function setCaptchaParams(m, params, fields) {
409
- var captchaConfig = l.captcha(m);
410
- var isCaptchaRequired = captchaConfig && l.captcha(m).get('required');
411
- if (!isCaptchaRequired) {
412
- return true;
413
- }
414
- var captcha = c.getFieldValue(m, 'captcha');
415
- //captcha required and missing
416
- if (!captcha) {
417
- return false;
418
- }
419
-
420
- params['captcha'] = captcha;
421
- fields.push('captcha');
422
- return true;
423
- }
@@ -24,6 +24,8 @@ var _password_pane2 = _interopRequireDefault(_password_pane);
24
24
 
25
25
  var _actions = require('./actions');
26
26
 
27
+ var _captcha = require('../captcha');
28
+
27
29
  var _index = require('./index');
28
30
 
29
31
  var _index2 = require('../../core/index');
@@ -34,6 +36,12 @@ var _captcha_pane = require('../../field/captcha/captcha_pane');
34
36
 
35
37
  var _captcha_pane2 = _interopRequireDefault(_captcha_pane);
36
38
 
39
+ var _classic = require('../../engine/classic');
40
+
41
+ var _enterprise = require('../enterprise');
42
+
43
+ var _database = require('../database');
44
+
37
45
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
38
46
 
39
47
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -83,6 +91,7 @@ var LoginPane = function (_React$Component) {
83
91
  headerText
84
92
  );
85
93
  var resolver = l.connectionResolver(lock);
94
+ var sso = (0, _classic.isSSOEnabled)(lock);
86
95
 
87
96
  // Should never validate format on login because of custom db connection and import mode.
88
97
  // If a custom resolver is in use, always use UsernamePane without validating format,
@@ -102,8 +111,8 @@ var LoginPane = function (_React$Component) {
102
111
  strictValidation: false
103
112
  });
104
113
 
105
- var captchaPane = l.captcha(lock) && l.captcha(lock).get('required') ? _react2.default.createElement(_captcha_pane2.default, { i18n: i18n, lock: lock, onReload: function onReload() {
106
- return (0, _actions.swapCaptcha)(l.id(lock), false);
114
+ var captchaPane = l.captcha(lock) && l.captcha(lock).get('required') && ((0, _enterprise.isHRDDomain)(lock, (0, _database.databaseUsernameValue)(lock)) || !sso) ? _react2.default.createElement(_captcha_pane2.default, { i18n: i18n, lock: lock, onReload: function onReload() {
115
+ return (0, _captcha.swapCaptcha)(l.id(lock), false);
107
116
  } }) : null;
108
117
 
109
118
  var dontRememberPassword = showForgotPasswordLink && (0, _index.hasScreen)(lock, 'forgotPassword') ? _react2.default.createElement(
@@ -30,6 +30,8 @@ var _index3 = require('../../core/index');
30
30
 
31
31
  var l = _interopRequireWildcard(_index3);
32
32
 
33
+ var _captcha = require('../captcha');
34
+
33
35
  var _index4 = require('../database/index');
34
36
 
35
37
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
@@ -57,6 +59,8 @@ function logIn(id) {
57
59
  var ssoConnection = (0, _enterprise.matchConnection)(m, email);
58
60
  var enterpriseConnection = (0, _enterprise.enterpriseActiveFlowConnection)(m);
59
61
  var connectionScopes = getConnectionScopesFrom(m, ssoConnection || enterpriseConnection);
62
+ var usernameField = (0, _index4.databaseLogInWithEmail)(m) ? 'email' : 'username';
63
+ var fields = [usernameField, 'password'];
60
64
 
61
65
  var params = {
62
66
  connection_scope: connectionScopes ? connectionScopes.toJS() : undefined
@@ -66,6 +70,12 @@ function logIn(id) {
66
70
  return logInSSO(id, ssoConnection, params);
67
71
  }
68
72
 
73
+ var isCaptchaValid = (0, _captcha.setCaptchaParams)(m, params, fields);
74
+
75
+ if (!isCaptchaValid && !ssoConnection) {
76
+ return (0, _captcha.showMissingCaptcha)(m, id);
77
+ }
78
+
69
79
  logInActiveFlow(id, params);
70
80
  }
71
81
 
@@ -83,7 +93,10 @@ function logInActiveFlow(id, params) {
83
93
  username: username,
84
94
  password: (0, _index2.getFieldValue)(m, 'password'),
85
95
  login_hint: username
86
- }));
96
+ }), function (id, error, fields, next) {
97
+ var wasCaptchaInvalid = error && error.code === 'invalid captcha';
98
+ (0, _captcha.swapCaptcha)(id, wasCaptchaInvalid, next);
99
+ });
87
100
  }
88
101
 
89
102
  function logInSSO(id, connection, params) {
@@ -18,6 +18,12 @@ var _password_pane = require('../../field/password/password_pane');
18
18
 
19
19
  var _password_pane2 = _interopRequireDefault(_password_pane);
20
20
 
21
+ var _captcha_pane = require('../../field/captcha/captcha_pane');
22
+
23
+ var _captcha_pane2 = _interopRequireDefault(_captcha_pane);
24
+
25
+ var _captcha = require('../captcha');
26
+
21
27
  var _index = require('../../core/index');
22
28
 
23
29
  var l = _interopRequireWildcard(_index);
@@ -50,6 +56,10 @@ var HRDPane = function (_React$Component) {
50
56
  usernameInputPlaceholder = _props.usernameInputPlaceholder;
51
57
 
52
58
 
59
+ var captchaPane = l.captcha(model) && l.captcha(model).get('required') ? _react2.default.createElement(_captcha_pane2.default, { i18n: i18n, lock: model, onReload: function onReload() {
60
+ return (0, _captcha.swapCaptcha)(l.id(model), false);
61
+ } }) : null;
62
+
53
63
  return _react2.default.createElement(
54
64
  'div',
55
65
  null,
@@ -61,7 +71,8 @@ var HRDPane = function (_React$Component) {
61
71
  validateFormat: false,
62
72
  strictValidation: false
63
73
  }),
64
- _react2.default.createElement(_password_pane2.default, { i18n: i18n, lock: model, placeholder: passwordInputPlaceholder })
74
+ _react2.default.createElement(_password_pane2.default, { i18n: i18n, lock: model, placeholder: passwordInputPlaceholder }),
75
+ captchaPane
65
76
  );
66
77
  };
67
78
 
@@ -176,5 +176,5 @@ function trimAuthParams() {
176
176
  }
177
177
 
178
178
  function getVersion() {
179
- return '11.31.0';
179
+ return '11.32.2';
180
180
  }
@@ -60,7 +60,8 @@ var Auth0APIClient = function () {
60
60
  _telemetryInfo: telemetry,
61
61
  state: state,
62
62
  nonce: nonce,
63
- scope: scope
63
+ scope: scope,
64
+ legacySameSiteCookie: opts.legacySameSiteCookie
64
65
  });
65
66
 
66
67
  this.authOpt = {
@@ -66,7 +66,7 @@ function shouldRenderTabs(m) {
66
66
  if (l.hasSomeConnections(m, 'social') && (0, _index.hasInitialScreen)(m, 'signUp')) return (0, _index.hasScreen)(m, 'signUp');
67
67
  }
68
68
 
69
- var Component = function Component(_ref) {
69
+ var LoginComponent = function LoginComponent(_ref) {
70
70
  var i18n = _ref.i18n,
71
71
  model = _ref.model;
72
72
 
@@ -182,7 +182,7 @@ var Login = function (_Screen) {
182
182
  };
183
183
 
184
184
  Login.prototype.render = function render() {
185
- return Component;
185
+ return LoginComponent;
186
186
  };
187
187
 
188
188
  return Login;
@@ -32,7 +32,11 @@ var _index2 = require('../../core/index');
32
32
 
33
33
  var l = _interopRequireWildcard(_index2);
34
34
 
35
- var _actions = require('../../connection/database/actions');
35
+ var _captcha = require('../../connection/captcha');
36
+
37
+ var _enterprise = require('../../connection/enterprise');
38
+
39
+ var _classic = require('../classic');
36
40
 
37
41
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
38
42
 
@@ -71,6 +75,7 @@ var SignUpPane = function (_React$Component) {
71
75
  null,
72
76
  headerText
73
77
  );
78
+ var sso = (0, _classic.isSSOEnabled)(model);
74
79
 
75
80
  var usernamePane = !onlyEmail && (0, _index.databaseConnectionRequiresUsername)(model) && !(0, _index.signUpHideUsernameField)(model) ? _react2.default.createElement(_username_pane2.default, {
76
81
  i18n: i18n,
@@ -96,8 +101,8 @@ var SignUpPane = function (_React$Component) {
96
101
  });
97
102
  });
98
103
 
99
- var captchaPane = l.captcha(model) && l.captcha(model).get('required') ? _react2.default.createElement(_captcha_pane2.default, { i18n: i18n, lock: model, onReload: function onReload() {
100
- return (0, _actions.swapCaptcha)(l.id(model), false);
104
+ var captchaPane = l.captcha(model) && l.captcha(model).get('required') && ((0, _enterprise.isHRDDomain)(model, (0, _index.databaseUsernameValue)(model)) || !sso) ? _react2.default.createElement(_captcha_pane2.default, { i18n: i18n, lock: model, onReload: function onReload() {
105
+ return (0, _captcha.swapCaptcha)(l.id(model), false);
101
106
  } }) : null;
102
107
 
103
108
  var passwordPane = !onlyEmail && _react2.default.createElement(_password_pane2.default, {
@@ -53,14 +53,10 @@ var CaptchaPane = function (_React$Component) {
53
53
  lock = _props.lock,
54
54
  onReload = _props.onReload;
55
55
 
56
-
57
56
  var lockId = l.id(lock);
58
-
59
57
  var captcha = l.captcha(lock);
60
-
61
58
  var value = (0, _index3.getFieldValue)(lock, 'captcha');
62
59
  var isValid = !(0, _index3.isFieldVisiblyInvalid)(lock, 'captcha');
63
-
64
60
  var provider = captcha.get('provider');
65
61
 
66
62
  if ((0, _recaptcha.isRecaptcha)(provider)) {
package/lib/i18n/de.js CHANGED
@@ -77,7 +77,7 @@ exports.default = {
77
77
  loginAtLabel: 'Anmelden bei %s',
78
78
  loginLabel: 'Anmelden',
79
79
  loginSubmitLabel: 'Anmelden',
80
- loginWithLabel: 'Anmelden mit %s',
80
+ loginWithLabel: 'Mit %s anmelden',
81
81
  notYourAccountAction: 'Falsches Konto?',
82
82
  passwordInputPlaceholder: 'Ihr Passwort',
83
83
  passwordStrength: {
package/lib/i18n.js CHANGED
@@ -125,7 +125,7 @@ function assertLanguage(m, language, base) {
125
125
  function syncLang(m, language, _cb) {
126
126
  (0, _cdn_utils.load)({
127
127
  method: 'registerLanguageDictionary',
128
- url: l.languageBaseUrl(m) + '/js/lock/' + '11.31.0' + '/' + language + '.js',
128
+ url: l.languageBaseUrl(m) + '/js/lock/' + '11.32.2' + '/' + language + '.js',
129
129
  check: function check(str) {
130
130
  return str && str === language;
131
131
  },
@@ -141,7 +141,9 @@ function registerLanguageDictionary(language, dictionary) {
141
141
  languageDictionaries[language] = _immutable2.default.fromJS(dictionary);
142
142
  }
143
143
 
144
- (0, _cdn_utils.preload)({
145
- method: 'registerLanguageDictionary',
146
- cb: registerLanguageDictionary
147
- });
144
+ if (typeof window !== 'undefined') {
145
+ (0, _cdn_utils.preload)({
146
+ method: 'registerLanguageDictionary',
147
+ cb: registerLanguageDictionary
148
+ });
149
+ }
package/lib/lock.js CHANGED
@@ -42,7 +42,7 @@ var Auth0Lock = function (_Core) {
42
42
 
43
43
 
44
44
  exports.default = Auth0Lock;
45
- Auth0Lock.version = '11.31.0';
45
+ Auth0Lock.version = '11.32.2';
46
46
 
47
47
  // TODO: should we have different telemetry for classic/passwordless?
48
48
  // TODO: should we set telemetry info before each request?
@@ -41,4 +41,4 @@ var Auth0LockPasswordless = function (_Core) {
41
41
  exports.default = Auth0LockPasswordless;
42
42
 
43
43
 
44
- Auth0LockPasswordless.version = '11.31.0';
44
+ Auth0LockPasswordless.version = '11.32.2';
@@ -176,7 +176,10 @@ var SubmitButton = function (_React$Component) {
176
176
  color = _props2.color,
177
177
  disabled = _props2.disabled,
178
178
  label = _props2.label,
179
- display = _props2.display;
179
+ display = _props2.display,
180
+ contentProps = _props2.contentProps;
181
+ var model = contentProps.model;
182
+
180
183
 
181
184
  var content = label ? _react2.default.createElement(
182
185
  'span',
@@ -188,6 +191,7 @@ var SubmitButton = function (_React$Component) {
188
191
  return _react2.default.createElement(
189
192
  'button',
190
193
  {
194
+ id: l.id(model) + '-submit',
191
195
  className: 'auth0-lock-submit',
192
196
  disabled: disabled,
193
197
  style: { backgroundColor: color, display: display },
@@ -112,7 +112,7 @@ var EscKeyDownHandler = function () {
112
112
  return EscKeyDownHandler;
113
113
  }();
114
114
 
115
- var IPHONE = window.navigator && !!window.navigator.userAgent.match(/iPhone/i);
115
+ var IPHONE = typeof window !== 'undefined' && window.navigator && !!window.navigator.userAgent.match(/iPhone/i);
116
116
 
117
117
  var Container = function (_React$Component) {
118
118
  _inherits(Container, _React$Component);
@@ -384,7 +384,7 @@ Container.propTypes = {
384
384
  };
385
385
 
386
386
  // NOTE: detecting the file protocol is important for things like electron.
387
- var isFileProtocol = window.window && window.location && window.location.protocol === 'file:';
387
+ var isFileProtocol = typeof window !== 'undefined' && window.window && window.location && window.location.protocol === 'file:';
388
388
 
389
389
  var defaultProps = exports.defaultProps = Container.defaultProps = {
390
390
  autofocus: false,
@@ -155,12 +155,17 @@ WelcomeMessage.propTypes = {
155
155
  };
156
156
 
157
157
  var cssBlurSupport = function () {
158
+ if (typeof window === 'undefined') {
159
+ return;
160
+ }
161
+
158
162
  // Check stolen from Modernizr, see https://github.com/Modernizr/Modernizr/blob/29eab707f7a2fb261c8a9c538370e97eb1f86e25/feature-detects/css/filters.js
159
163
  var isEdge = window.navigator && !!window.navigator.userAgent.match(/Edge/i);
160
164
  if (typeof window.document === 'undefined' || isEdge) return false;
161
165
 
162
166
  var el = window.document.createElement('div');
163
167
  el.style.cssText = 'filter: blur(2px); -webkit-filter: blur(2px)';
168
+
164
169
  return !!el.style.length && (window.document.documentMode === undefined || window.document.documentMode > 9);
165
170
  }();
166
171
 
@@ -116,6 +116,7 @@ var PasswordInput = function (_React$Component) {
116
116
  _react2.default.createElement('input', _extends({
117
117
  ref: 'input',
118
118
  type: showPassword ? 'text' : 'password',
119
+ id: l.id(lock) + '-password',
119
120
  name: 'password',
120
121
  className: 'auth0-lock-input',
121
122
  autoComplete: allowPasswordAutocomplete ? 'on' : 'off',
@@ -10,7 +10,7 @@ var _auth0Js2 = _interopRequireDefault(_auth0Js);
10
10
 
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
12
 
13
- if (!window.Auth0) {
13
+ if (typeof window !== 'undefined' && !window.Auth0) {
14
14
  window.Auth0 = {};
15
15
  }
16
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auth0-lock",
3
- "version": "11.31.0",
3
+ "version": "11.32.2",
4
4
  "description": "Auth0 Lock",
5
5
  "author": "Auth0 <support@auth0.com> (http://auth0.com)",
6
6
  "license": "MIT",
@@ -105,17 +105,17 @@
105
105
  "webpack-dev-server": "^2.3.0"
106
106
  },
107
107
  "dependencies": {
108
- "auth0-js": "^9.16.4",
108
+ "auth0-js": "^9.19.0",
109
109
  "auth0-password-policies": "^1.0.2",
110
- "blueimp-md5": "^2.18.0",
110
+ "blueimp-md5": "^2.19.0",
111
111
  "classnames": "^2.3.1",
112
- "dompurify": "^2.2.8",
112
+ "dompurify": "^2.3.4",
113
113
  "immutable": "^3.7.3",
114
114
  "jsonp": "^0.2.1",
115
- "node-fetch": "^2.6.1",
115
+ "node-fetch": "^2.6.7",
116
116
  "password-sheriff": "^1.1.1",
117
- "prop-types": "^15.6.0",
118
- "qs": "^6.7.0",
117
+ "prop-types": "^15.8.0",
118
+ "qs": "^6.10.3",
119
119
  "react": "^15.6.2",
120
120
  "react-dom": "^15.6.2",
121
121
  "react-transition-group": "^2.2.1",