8000 Update auth0-js and support legacySameSiteCookie option by stevehobbsdev · Pull Request #2089 · auth0/lock · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Update auth0-js and support legacySameSiteCookie option #2089

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

10000
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,11 @@ Specify your hooks using a new `hooks` configuration item when setting up the li
```js
new Auth0Lock('client ID', 'domain', {
hooks: {
loggingIn: function(context, cb) {
loggingIn: function (context, cb) {
console.log('Hello from the login hook!');
cb();
},
signingUp: function(context, cb) {
signingUp: function (context, cb) {
console.log('Hello from the sign-up hook!');
cb();
}
Expand All @@ -434,12 +434,12 @@ The developer can throw an error to block the login or sign-up process. The deve
```js
new Auth0Lock('client ID', 'domain', {
hooks: {
loggingIn: function(context, cb) {
loggingIn: function (context, cb) {
// Throw an object with code: `hook_error` to display this on the Login screen
throw { code: 'hook_error', description: 'There was an error in the login hook!' };

// Throw something generic to show a fallback error message
throw "Some error happened";
throw 'Some error happened';
}
}
});
Expand All @@ -453,6 +453,7 @@ new Auth0Lock('client ID', 'domain', {
- **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`.
- **hashCleanup {Boolean}**: When enabled, it will remove the hash part of the callback URL after the user authentication. Defaults to `true`.
- **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).**
- **legacySameSiteCookie**: If `false`, no compatibility cookies will be created for those browsers that do not understand the `SameSite` attribute. Defaults to `true`

```js
var options = {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"webpack-dev-server": "^2.3.0"
},
"dependencies": {
"auth0-js": "^9.18.0",
"auth0-js": "^9.19.0",
"auth0-password-policies": "^1.0.2",
"blueimp-md5": "^2.19.0",
"classnames": "^2.3.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Object {
"clientID": "cid",
"domain": "me.auth0.com",
"leeway": 30,
"legacySameSiteCookie": undefined,
"nonce": "nonce",
"overrides": Object {
"__jwks_uri": "https://jwks.com",
Expand Down Expand Up @@ -72,6 +73,7 @@ Object {
"clientID": "cid",
"domain": "me.auth0.com",
"leeway": 60,
"legacySameSiteCookie": undefined,
"nonce": "nonce",
"overrides": Object {
"__jwks_uri": "https://jwks.com",
Expand Down
3 changes: 2 additions & 1 deletion src/core/web_api/p2_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ class Auth0APIClient {
_telemetryInfo: telemetry,
state,
nonce,
scope
scope,
legacySameSiteCookie: opts.legacySameSiteCookie
});

this.authOpt = {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -760,10 +760,10 @@ atob@^2.1.2:
resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==

auth0-js@^9.18.0:
version "9.18.0"
resolved "https://registry.yarnpkg.com/auth0-js/-/auth0-js-9.18.0.tgz#4d69b93401ce39583d21e3aeae04c323a9f518e7"
integrity sha512-pTQyRLjWAXl7nUHfyFRWhDHMRtQpRJYKU5m3MdPNwem8iQR7KI4c3eHmVV90hpW6gM9jdjNjSmEPyHTxeaqxBA==
auth0-js@^9.19.0:
version "9.19.0"
resolved "https://registry.yarnpkg.com/auth0-js/-/auth0-js-9.19.0.tgz#09fcf97465c5a9a93b23c63056f9e45d8d4b3be2"
integrity sha512-PbzzGqtcfUZj3jnPqEcJYoWH+YNMmHI9woRYBY1VZn+GaU5NIWR1H/2ZAx5ZERZXvte6qQsu2FDNB8V+1N9Ahg==
dependencies:
base64-js "^1.5.1"
idtoken-verifier "^2.2.2"
Expand Down
0