Skip to content

Commit

Permalink
Promote v12 beta into master (#2242)
Browse files Browse the repository at this point in the history
* Remove Bower support (#2198)

remove build assets, bower.json and exclude

* [SDK-3789] Upgrade to React 18 (#2209)

* install react, react-dom 18

* use createRoot instead of render

* use @cfaester/enzyme-adapter-react-18 and update snapshots

* fix up async issues in E2E tests

* run yarn upgrade

* fix up another failing async test with helpers

* use lts browsers in Circle build

* remove dependency on 'node-fetch'

* use UNSAFE_ for componentWilReceiveProps

* [SDK-3796] Upgrade to Webpack 5 (#2213)

* use @cfaester/enzyme-adapter-react-18 and update snapshots

* fix up async issues in E2E tests

* run yarn upgrade

* upgrade to webpack 3

* upgrade webpack to 4.x

* wip - upgrade to babel 7

* upgrade UnminifiedWebpackPlugin

* update jest to latest and update tests & snapshots

* update karma dependencies

* upgrade to webpack 5

* adding polyfills

* tweaks to fix e2e tests

* enable browserstack tests on IE11

* attempting to fix concurrency issues in browserstack runs

* add new line for browserslistrc

* Update src/__tests__/core/index.test.js

Co-authored-by: Rita Zerrizuela <[email protected]>

Co-authored-by: Rita Zerrizuela <[email protected]>

* [chore] update readme for the beta (#2217)

Update readme for the beta

* release v12.0.0-beta.0 (#2218)

* Update circle config to use latest ship-orb (#2219)

* Update README.md (#2220)

* Update readme for release (#2239)

* chore: update docs for GA release

* chore: build lockfile using yarn@2

* Merge master into beta (#2240)

* Bump auth0-js from 9.19.2 to 9.20.0 (#2221)

Bumps [auth0-js](https://github.com/auth0/auth0.js) from 9.19.2 to 9.20.0.
- [Release notes](https://github.com/auth0/auth0.js/releases)
- [Changelog](https://github.com/auth0/auth0.js/blob/master/CHANGELOG.md)
- [Commits](auth0/auth0.js@v9.19.2...v9.20.0)

---
updated-dependencies:
- dependency-name: auth0-js
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* IAMRISK-1790 Support captcha for Passwordless (#2222)

* initial changes for email passwordless login screen

* updated tests

* Fix test for passwordless/social_or_email_login_screen

Fixes for a couple of issues:

**Circular dependency error**

Thanks to the email field, it was trying to use a function `isHRDEmailValid` from 'connection/enterprise', which isn't necessary for this test (I don't *think* you can have enterprise passwordless connections, you would just use the non-passwordless version of Lock). Mocking out this module and just returning `false` for `isHRDEmailValid` makes things simpler.

**m.getIn is not a function**

This is down to `social_or_email_login_screen` calling `hasSomeConnections` from 'core/index', this can simply be mocked to return `true` for this test. This function just verifies that there is a passwordless or email connection available.

I also had to mock out i18n.html, as this function is called when the component renders.

* add capthca pane to social or email login screen (failing tests)

* Remove unneeded lines

* add captcha to passwordless login screens, with unit tests passing

* got rid of sso

* got rid of enterprise check

* deleted unncessary imports

* Captcha support for Passwordless

* Update passwordless snapshots

* Error translations

* Swap captcha if restarting passwordless

* Add missing fun argument docs

* Use invalid_recaptcha error key for recaptcha_enterprise

* Resolve deps publicly

* Fix bug to correctly reset captcha field

* Remove conditional for non objects

* Add missing translations

Co-authored-by: kaki1104 <[email protected]>
Co-authored-by: Steve Hobbs <[email protected]>

* Release v11.35.0 (#2223)

release v11.35.0

* Bump eslint-config-prettier from 8.5.0 to 8.6.0

Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.5.0 to 8.6.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](prettier/eslint-config-prettier@v8.5.0...v8.6.0)

---
updated-dependencies:
- dependency-name: eslint-config-prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump dompurify from 2.4.1 to 2.4.3 (#2232)

Bumps [dompurify](https://github.com/cure53/DOMPurify) from 2.4.1 to 2.4.3.
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](cure53/DOMPurify@2.4.1...2.4.3)

---
updated-dependencies:
- dependency-name: dompurify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump prettier from 2.8.1 to 2.8.2 (#2231)

Bumps [prettier](https://github.com/prettier/prettier) from 2.8.1 to 2.8.2.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](prettier/prettier@2.8.1...2.8.2)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump eslint-plugin-react from 7.31.11 to 7.32.0 (#2233)

Bumps [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) from 7.31.11 to 7.32.0.
- [Release notes](https://github.com/jsx-eslint/eslint-plugin-react/releases)
- [Changelog](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](jsx-eslint/eslint-plugin-react@v7.31.11...v7.32.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-react
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump prettier from 2.8.2 to 2.8.3 (#2237)

* Bump auth0-js from 9.20.0 to 9.20.1 (#2235)

* Bump eslint-plugin-react from 7.32.0 to 7.32.1 (#2238)

Bumps [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) from 7.32.0 to 7.32.1.
- [Release notes](https://github.com/jsx-eslint/eslint-plugin-react/releases)
- [Changelog](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](jsx-eslint/eslint-plugin-react@v7.32.0...v7.32.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-react
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump node-fetch from 2.6.7 to 2.6.8 (#2236)

Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.7 to 2.6.8.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Commits](node-fetch/node-fetch@v2.6.7...v2.6.8)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rita Zerrizuela <[email protected]>
Co-authored-by: Steve Hobbs <[email protected]>

* Use latest ship-orb in CI (#2234)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Robin Bijlani <[email protected]>
Co-authored-by: kaki1104 <[email protected]>
Co-authored-by: Steve Hobbs <[email protected]>
Co-authored-by: Rita Zerrizuela <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Rita Zerrizuela <[email protected]>
Co-authored-by: Frederik Prijck <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Robin Bijlani <[email protected]>
Co-authored-by: kaki1104 <[email protected]>
Co-authored-by: Steve Hobbs <[email protected]>
  • Loading branch information
7 people authored Jan 20, 2023
1 parent 283bd6b commit b4a601e
Show file tree
Hide file tree
Showing 127 changed files with 17,393 additions and 62,257 deletions.
38 changes: 6 additions & 32 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,11 @@
"plugins": [
"version-inline",
"transform-css-import-to-string",
"babel-plugin-stylus-compiler"
"babel-plugin-stylus-compiler",
"@babel/plugin-proposal-function-bind"
],
"presets": [
[
"es2015",
{
"loose": true,
"modules": false
}
],
"stage-0",
"react"
],
"env": {
"test": {
"plugins": [
"transform-es2015-modules-commonjs"
]
},
"npm": {
"presets": [
[
"es2015",
{
"loose": true,
"modules": "commonjs"
}
],
"stage-0",
"react"
]
}
}
}
["@babel/preset-env", { "useBuiltIns": "entry", "corejs": "3.26.1" }],
"@babel/preset-react"
]
}
1 change: 1 addition & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
defaults, last 2 versions, not dead, IE 11
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,12 @@ workflows:
requires:
- build-and-test
pkg-manager: yarn
node-version: 18.12.1
context:
- publish-npm
- publish-gh
filters:
branches:
only:
- master
- beta
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ npm-debug.log
.idea/
.env
local.log
yarn-error.log
yarn-error.log
build/
.yarn/
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ scripts/
src/
support/
test/
bower.json
Gruntfile.js
.css.map
*~
Expand Down
9 changes: 4 additions & 5 deletions .shiprc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"files": {
"bower.json": [],
"README.md": []
},
"postbump": "yarn dist build"
"files": {
"README.md": []
},
"postbump": "yarn dist build"
}
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Place your settings in this file to overwrite default and user settings.
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/lib": true,
"**/coverage": true,
"**/examples": true,
Expand Down
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Change Log

## [v11.35.0](https://github.com/auth0/lock/tree/v11.35.0) (2022-12-19)

[Full Changelog](https://github.com/auth0/lock/compare/v11.34.2...v11.35.0)
Expand All @@ -18,6 +17,17 @@
- Update okta logo [\#2201](https://github.com/auth0/lock/pull/2201) ([jamescgarrett](https://github.com/jamescgarrett))
- Update readme to match new design [\#2187](https://github.com/auth0/lock/pull/2187) ([ewanharris](https://github.com/ewanharris))

## [v12.0.0-beta.0](https://github.com/auth0/lock/tree/v12.0.0-beta.0) (2022-12-08)

[Full Changelog](https://github.com/auth0/lock/compare/v11.34.2...v12.0.0-beta.0)

:warning: This is a **beta release** of Lock.js v12 that includes an upgrade to React 18, and should not be used in production. If you find any issues, please [submit a bug report](https://github.com/auth0/lock/issues/new?assignees=&labels=bug+report,v12-beta&template=report_a_bug.md&title=).

**Changed**

- Upgrade to React 18 [\#2209](https://github.com/auth0/lock/pull/2209) ([stevehobbsdev](https://github.com/stevehobbsdev))
- Upgrade to Webpack 5, Jest 29, Babel 8 [\#2213](https://github.com/auth0/lock/pull/2213) ([stevehobbsdev](https://github.com/stevehobbsdev))
- bump dependencies to latest patch and fix typos [\#2210](https://github.com/auth0/lock/pull/2210) ([piwysocki](https://github.com/piwysocki))
## [v11.34.2](https://github.com/auth0/lock/tree/v11.34.2) (2022-10-10)

[Full Changelog](https://github.com/auth0/lock/compare/v11.34.1...v11.34.2)
Expand Down
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Requires:

- [Yarn](https://yarnpkg.com/)
- >= Node 10.18.1
- [Node LTS](https://nodejs.org)

## Building

Expand Down
54 changes: 11 additions & 43 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,11 @@
'use strict';

const path = require('path');
const fs = require('fs');
const tmp = require('tmp');
const pkg = require('./package');
const webpack = require('webpack');
const webpackConfig = require('./webpack.config.js');
const UnminifiedWebpackPlugin = require('unminified-webpack-plugin');
const { spawnSync } = require('child_process');

/**
* This is a helper function to generate valid certs using mkcert.
* If mkcert is not installed it will return false.
*/
function getDevCerts() {
let result = false;
const tmpDir = tmp.dirSync({ unsafeCleanup: true, prefix: 'lock-dev-' });

try {
spawnSync('mkcert', ['localhost'], { cwd: tmpDir.name });
result = {
key: fs.readFileSync(path.join(tmpDir.name, 'localhost-key.pem')),
cert: fs.readFileSync(path.join(tmpDir.name, 'localhost.pem'))
};
} catch (err) {}

tmpDir.removeCallback();
return result;
}

module.exports = function(grunt) {
module.exports = function (grunt) {
const pkg_info = grunt.file.readJSON('package.json');

grunt.initConfig({
Expand Down Expand Up @@ -61,8 +37,9 @@ module.exports = function(grunt) {
touch_index: 'touch src/index.js'
},
webpack: {
options: webpackConfig,
build: {
...webpackConfig,
mode: 'production',
devtool: 'source-map',
output: {
path: path.join(__dirname, 'build'),
Expand All @@ -80,11 +57,6 @@ module.exports = function(grunt) {
}
}),
new webpack.optimize.AggressiveMergingPlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false, screw_ie8: true },
sourceMap: true,
comments: false
}),
new UnminifiedWebpackPlugin(),
new webpack.BannerPlugin({
raw: false,
Expand All @@ -98,17 +70,11 @@ module.exports = function(grunt) {
},
'webpack-dev-server': {
options: {
webpack: webpackConfig,
publicPath: '/build/'
},
dev: {
hot: true,
port: 3000,
https: getDevCerts() || true,
webpack: {
devtool: 'source-map'
output: {
publicPath: '/build/'
}
},
dev: webpackConfig,
design: {
webpack: {
entry: './support/design/index.js',
Expand Down Expand Up @@ -146,14 +112,16 @@ module.exports = function(grunt) {
grunt.registerTask('prepare_dev', ['clean:dev']);
grunt.registerTask('dev', ['prepare_dev', 'webpack-dev-server:dev']);
grunt.registerTask('design', ['prepare_dev', 'webpack-dev-server:design']);
grunt.registerMultiTask('i18n', 'Prepares i18n files to be hosted in CDN', function() {
grunt.registerMultiTask('i18n', 'Prepares i18n files to be hosted in CDN', function () {
var languages = {};

var Auth0 = {
registerLanguageDictionary: function(lang, dict) {
registerLanguageDictionary: function (lang, dict) {
languages[lang] = dict;
}
};
this.files.forEach(function(file) {

this.files.forEach(function (file) {
var filename = file.src[0];
var lang = path.basename(filename, '.js');
var dict = require('./' + filename).default || require('./' + filename);
Expand Down
38 changes: 17 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
![Auth0's configurable login form for web applications](https://cdn.auth0.com/website/sdks/banners/lock-banner.png)

![Release](https://img.shields.io/npm/v/auth0-lock)
![Downloads](https://img.shields.io/npm/dw/auth0-lock)
[![License](https://img.shields.io/:license-mit-blue.svg?style=flat)](https://opensource.org/licenses/MIT)
![CircleCI](https://img.shields.io/circleci/build/github/auth0/lock)

## Documentation
> :warning: Lock is built using React 18 from v12 onwards. Getting issues? Please [submit a bug report](https://github.com/auth0/lock/issues/new?assignees=&labels=bug+report,v12&template=report_a_bug.md&title=).
## Documentation

- [Docs Site](https://auth0.com/docs) - explore our Docs site and learn more about Auth0.

## Getting Started

### Browser Compatibility

We ensure browser compatibility in Chrome, Safari, Firefox and IE >= 10.
We ensure browser compatibility in Chrome, Safari, Firefox and IE >= 11.

### Installation

Using [npm](https://npmjs.org) in your project directory run the following command:
Install Lock into your project using [npm](https://npmjs.org):

```sh
npm install auth0-lock
```

From CDN

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

### Configure Auth0

Create a **Single Page Application** in the [Auth0 Dashboard](https://manage.auth0.com/#/applications).
Expand All @@ -40,44 +35,44 @@ Create a **Single Page Application** in the [Auth0 Dashboard](https://manage.aut
> - Scroll down and click on the "Show Advanced Settings" link.
> - Under "Advanced Settings", click on the "OAuth" tab.
> - Ensure that "JsonWebToken Signature Algorithm" is set to `RS256` and that "OIDC Conformant" is enabled.
Next, configure the following URLs for your application under the "Application URIs" section of the "Settings" page:
> Next, configure the following URLs for your application under the "Application URIs" section of the "Settings" page:
- **Allowed Callback URLs**: `http://localhost:3000`
- **Allowed Logout URLs**: `http://localhost:3000`
- **Allowed Web Origins**: `http://localhost:3000`

> These URLs should reflect the origins that your application is running on. **Allowed Callback URLs** may also include a path, depending on where you're handling the callback (see below).
Take note of the **Client ID** and **Domain** values under the "Basic Information" section. You'll need these values in the next step.
> Take note of the **Client ID** and **Domain** values under the "Basic Information" section. You'll need these values in the next step.
### Configure the SDK

Create either an `Auth0Lock` or `Auth0LockPasswordless` instance.
Create either an `Auth0Lock` or `Auth0LockPasswordless` instance, depending on your use case:

#### Auth0Lock

````js
```js
import { Auth0Lock } from 'auth0-lock';

const lock = new Auth0Lock('{YOUR_AUTH0_CLIENT_ID}', '{YOUR_AUTH0_DOMAIN}');
````
```

#### Auth0LockPasswordless

````js
```js
import { Auth0LockPasswordless } from 'auth0-lock';

const lock = new Auth0LockPasswordless('{YOUR_AUTH0_CLIENT_ID}', '{YOUR_AUTH0_DOMAIN}');
````
```

### Logging In

You can then configure a listener for the `authenticated` event to retrieve an access token and call `show` to display the Lock widget.
Configure a listener for the `authenticated` event to retrieve an access token and call `show` to display the Lock widget.

```html
<button id="login">Click to Login</button>
```

````js
```js
lock.on('authenticated', function (authResult) {
lock.getUserInfo(authResult.accessToken, function (error, profileResult) {
if (error) {
Expand All @@ -92,10 +87,11 @@ lock.on('authenticated', function (authResult) {
});
});

// Show the widget when the login button is clicked
document.getElementById('login').addEventListener('click', () => {
lock.show()
});.
````
```

For other comprehensive examples and documentation on the configuration options, see the [EXAMPLES.md](https://github.com/auth0/lock/blob/master/EXAMPLES.md) document.

Expand Down
20 changes: 0 additions & 20 deletions bower.json

This file was deleted.

1 change: 0 additions & 1 deletion build/af.js

This file was deleted.

Loading

0 comments on commit b4a601e

Please sign in to comment.