Socket
Socket
Sign inDemoInstall

auth0-lock

Package Overview
Dependencies
Maintainers
36
Versions
338
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auth0-lock - npm Package Compare versions

Comparing version 11.23.1 to 11.24.0

lib/__tests__/field/captcha.js

11

lib/__tests__/connection/passwordless/passwordless.js

@@ -252,2 +252,13 @@ 'use strict';

});
it('emits the "authorization_error" event', function () {
actions.sendSMS('id');
require('core/actions').validateAndSubmit.mock.calls[0][2]('model');
var error = new Error('foobar');
error.error = 'some_error_code';
require('core/web_api').startPasswordless.mock.calls[0][2](error);
jest.runAllTimers();
(0, _testUtils.expectMockToMatch)(require('core/index').emitAuthorizationErrorEvent, 1);
});
});

@@ -254,0 +265,0 @@ });

4

lib/__tests__/testUtils.js

@@ -21,4 +21,4 @@ 'use strict';

var expectComponent = exports.expectComponent = function expectComponent(children) {
var component = _reactTestRenderer2.default.create(children);
var expectComponent = exports.expectComponent = function expectComponent(children, opts) {
var component = _reactTestRenderer2.default.create(children, opts);
return expect(component);

@@ -25,0 +25,0 @@ };

@@ -49,5 +49,2 @@ 'use strict';

Chrome = getComponent();
Chrome.prototype.getHeaderSize = jest.fn(function () {
return 200;
});
});

@@ -54,0 +51,0 @@

@@ -141,2 +141,3 @@ 'use strict';

var errorMessage = getErrorMessage(m, error);
l.emitAuthorizationErrorEvent(m, error);
return (0, _index.swap)(_index.updateEntity, 'lock', id, l.setSubmitting, false, errorMessage);

@@ -143,0 +144,0 @@ }

@@ -179,3 +179,3 @@ 'use strict';

function getVersion() {
return '11.23.1';
return '11.24.0';
}

@@ -64,3 +64,3 @@ 'use strict';

// TODO: instructions can't be on EmailPane beacuse it breaks the CSS,
// TODO: instructions can't be on EmailPane because it breaks the CSS,
// all input fields needs to share a parent so the last one doesn't have

@@ -67,0 +67,0 @@ // a bottom margin.

@@ -29,2 +29,6 @@ 'use strict';

var _recaptchav = require('./recaptchav2');
var _recaptchav2 = _interopRequireDefault(_recaptchav);
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; } }

@@ -34,33 +38,61 @@

var Captcha = function Captcha(_ref) {
var lock = _ref.lock,
i18n = _ref.i18n,
onReload = _ref.onReload;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var lockId = l.id(lock);
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function handleChange(e) {
(0, _index2.swap)(_index2.updateEntity, 'lock', lockId, captchaField.set, e.target.value);
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* eslint-disable no-nested-ternary */
var CaptchaPane = function (_React$Component) {
_inherits(CaptchaPane, _React$Component);
function CaptchaPane() {
_classCallCheck(this, CaptchaPane);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
var captcha = l.captcha(lock);
CaptchaPane.prototype.render = function render() {
var _props = this.props,
i18n = _props.i18n,
lock = _props.lock,
onReload = _props.onReload;
var placeholder = captcha.get('type') === 'code' ? i18n.str('captchaCodeInputPlaceholder') : i18n.str('captchaMathInputPlaceholder');
var value = (0, _index3.getFieldValue)(lock, 'captcha');
var isValid = !(0, _index3.isFieldVisiblyInvalid)(lock, 'captcha');
var lockId = l.id(lock);
return _react2.default.createElement(_captcha_input2.default, {
lockId: lockId,
image: captcha.get('image'),
placeholder: placeholder,
isValid: isValid,
onChange: handleChange,
onReload: onReload,
value: value,
invalidHint: i18n.str('blankErrorHint')
});
}; /* eslint-disable no-nested-ternary */
function handleChange(e) {
(0, _index2.swap)(_index2.updateEntity, 'lock', lockId, captchaField.set, e.target.value);
}
Captcha.propTypes = {
var captcha = l.captcha(lock);
if (captcha.get('provider') === 'recaptcha_v2') {
return _react2.default.createElement(_recaptchav2.default, { lock: lock, siteKey: captcha.get('siteKey') });
}
var placeholder = captcha.get('type') === 'code' ? i18n.str('captchaCodeInputPlaceholder') : i18n.str('captchaMathInputPlaceholder');
var value = (0, _index3.getFieldValue)(lock, 'captcha');
var isValid = !(0, _index3.isFieldVisiblyInvalid)(lock, 'captcha');
return _react2.default.createElement(_captcha_input2.default, {
lockId: lockId,
image: captcha.get('image'),
placeholder: placeholder,
isValid: isValid,
onChange: handleChange,
onReload: onReload,
value: value,
invalidHint: i18n.str('blankErrorHint')
});
};
return CaptchaPane;
}(_react2.default.Component);
exports.default = CaptchaPane;
CaptchaPane.propTypes = {
i18n: _propTypes2.default.object.isRequired,
lock: _propTypes2.default.object.isRequired,

@@ -71,6 +103,4 @@ error: _propTypes2.default.bool,

Captcha.defaultProps = {
CaptchaPane.defaultProps = {
error: false
};
exports.default = Captcha;

@@ -34,3 +34,3 @@ 'use strict';

// chekc min value matched
// check min value matched
if (lowercased.length < settings.min) {

@@ -37,0 +37,0 @@ return false;

@@ -119,3 +119,3 @@ 'use strict';

method: 'registerLanguageDictionary',
url: l.languageBaseUrl(m) + '/js/lock/' + '11.23.1' + '/' + language + '.js',
url: l.languageBaseUrl(m) + '/js/lock/' + '11.24.0' + '/' + language + '.js',
check: function check(str) {

@@ -122,0 +122,0 @@ return str && str === language;

@@ -45,3 +45,3 @@ 'use strict';

exports.default = Auth0Lock;
Auth0Lock.version = '11.23.1';
Auth0Lock.version = '11.24.0';

@@ -48,0 +48,0 @@ // TODO: should we have different telemetry for classic/passwordless?

@@ -39,2 +39,2 @@ 'use strict';

Auth0LockPasswordless.version = '11.23.1';
Auth0LockPasswordless.version = '11.24.0';

@@ -146,3 +146,3 @@ 'use strict';

_this2.state = { moving: false, reverse: false, headerHeight: 0 };
_this2.state = { moving: false, reverse: false };
return _this2;

@@ -229,6 +229,2 @@ }

Chrome.prototype.componentDidMount = function componentDidMount() {
this.setState({ headerHeight: this.getHeaderSize() });
};
Chrome.prototype.onWillSlide = function onWillSlide() {

@@ -274,19 +270,2 @@ this.setState({ moving: true });

// Record the header element so that we can retrieve its size when the
// component renders
Chrome.prototype.setHeaderElement = function setHeaderElement(element) {
this.header = element;
};
// Get the size (rather than the element itself), as returning
// the element makes this difficult to test (we can't reasonably enforce the size
// as it's not rendered to a screen).
Chrome.prototype.getHeaderSize = function getHeaderSize() {
return this.header ? this.header.getDOMNode().clientHeight : 0;
};
Chrome.prototype.render = function render() {

@@ -377,11 +356,7 @@ var _this5 = this;

backgroundColor: primaryColor,
logoUrl: logo,
ref: this.setHeaderElement.bind(this)
logoUrl: logo
}),
_react2.default.createElement(
'div',
{
className: 'auth0-lock-content-body-wrapper',
style: { marginTop: this.state.headerHeight }
},
{ className: 'auth0-lock-content-body-wrapper' },
_react2.default.createElement(

@@ -388,0 +363,0 @@ _reactTransitionGroup.TransitionGroup,

@@ -38,2 +38,9 @@ 'use strict';

Header.prototype.setHeaderHeightStyle = function setHeaderHeightStyle(headerElement) {
if (headerElement) {
var height = headerElement.clientHeight || 0;
document.documentElement.style.setProperty('--header-height', height + 'px');
}
};
Header.prototype.getDOMNode = function getDOMNode() {

@@ -55,3 +62,3 @@ return _reactDom2.default.findDOMNode(this);

'div',
{ className: 'auth0-lock-header' },
{ className: 'auth0-lock-header', ref: this.setHeaderHeightStyle.bind(this) },
backHandler && _react2.default.createElement(_button.BackButton, { onClick: backHandler }),

@@ -58,0 +65,0 @@ _react2.default.createElement(Background, { imageUrl: backgroundUrl, backgroundColor: backgroundColor, grayScale: !!name }),

{
"name": "auth0-lock",
"version": "11.23.1",
"version": "11.24.0",
"description": "Auth0 Lock",

@@ -5,0 +5,0 @@ "author": "Auth0 <support@auth0.com> (http://auth0.com)",

@@ -26,3 +26,3 @@ [![NPM version][npm-image]][npm-url]

<!-- Latest patch release (recommended for production) -->
<script src="https://cdn.auth0.com/js/lock/11.23.1/lock.min.js"></script>
<script src="https://cdn.auth0.com/js/lock/11.24.0/lock.min.js"></script>
```

@@ -29,0 +29,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc