Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

@auth0/auth0-spa-js

Package Overview
Dependencies
8
Maintainers
42
Versions
89
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.14.0 to 1.15.0

9

CHANGELOG.md
# Change Log
## [v1.15.0](https://github.com/auth0/auth0-spa-js/tree/v1.15.0) (2021-04-29)
[Full Changelog](https://github.com/auth0/auth0-spa-js/compare/v1.14.0...v1.15.0)
**Added**
- Add Popup cancelled event [\#724](https://github.com/auth0/auth0-spa-js/pull/724) ([degrammer](https://github.com/degrammer))
**Fixed**
- Fix popup blocker showing for loginWithPopup in Firefox & Safari [\#732](https://github.com/auth0/auth0-spa-js/pull/732) ([stevehobbsdev](https://github.com/stevehobbsdev))
## [v1.14.0](https://github.com/auth0/auth0-spa-js/tree/v1.14.0) (2021-03-22)

@@ -4,0 +13,0 @@

8

dist/typings/Auth0Client.d.ts

@@ -38,3 +38,9 @@ import { Auth0ClientOptions, RedirectLoginOptions, PopupLoginOptions, PopupConfigOptions, GetUserOptions, GetIdTokenClaimsOptions, RedirectLoginResult, GetTokenSilentlyOptions, GetTokenWithPopupOptions, LogoutOptions, CacheLocation, LogoutUrlOptions, User, IdToken } from './global';

* ```js
* await auth0.loginWithPopup(options);
* try {
* await auth0.loginWithPopup(options);
* } catch(e) {
* if (e instanceof PopupCancelledError) {
* // Popup was closed before login completed
* }
* }
* ```

@@ -41,0 +47,0 @@ *

@@ -36,1 +36,5 @@ /**

}
export declare class PopupCancelledError extends GenericError {
popup: Window;
constructor(popup: Window);
}

2

dist/typings/global.d.ts

@@ -68,3 +68,3 @@ /**

/**
* The Id of an organization to log in to (Organizations is currently a Closed Beta).
* The Id of an organization to log in to.
*

@@ -71,0 +71,0 @@ * This will specify an `organization` parameter in your user's login request and will add a step to validate

@@ -17,2 +17,2 @@ import 'core-js/es/string/starts-with';

export { Auth0Client };
export { GenericError, AuthenticationError, TimeoutError, PopupTimeoutError } from './errors';
export { GenericError, AuthenticationError, TimeoutError, PopupTimeoutError, PopupCancelledError } from './errors';
import { AuthenticationResult, PopupConfigOptions } from './global';
export declare const parseQueryResult: (queryString: string) => AuthenticationResult;
export declare const runIframe: (authorizeUrl: string, eventOrigin: string, timeoutInSeconds?: number) => Promise<AuthenticationResult>;
export declare const runPopup: (authorizeUrl: string, config: PopupConfigOptions) => Promise<AuthenticationResult>;
export declare const openPopup: (url: string) => Window;
export declare const runPopup: (config: PopupConfigOptions) => Promise<AuthenticationResult>;
export declare const getCrypto: () => Crypto;

@@ -6,0 +7,0 @@ export declare const getCryptoSubtle: () => any;

@@ -1,2 +0,2 @@

declare const _default: "1.14.0";
declare const _default: "1.15.0";
export default _default;

@@ -6,3 +6,3 @@ {

"license": "MIT",
"version": "1.14.0",
"version": "1.15.0",
"main": "dist/lib/auth0-spa-js.cjs.js",

@@ -39,19 +39,19 @@ "types": "dist/typings/index.d.ts",

"@auth0/component-cdn-uploader": "github:auth0/component-cdn-uploader#v2.2.2",
"@rollup/plugin-replace": "^2.3.4",
"@rollup/plugin-replace": "^2.4.2",
"@types/cypress": "^1.1.3",
"@types/jest": "^26.0.16",
"@typescript-eslint/eslint-plugin-tslint": "^4.9.0",
"@typescript-eslint/parser": "^4.9.0",
"cli-table": "^0.3.1",
"@types/jest": "^26.0.23",
"@typescript-eslint/eslint-plugin-tslint": "^4.22.0",
"@typescript-eslint/parser": "^4.22.0",
"cli-table": "^0.3.6",
"codecov": "^3.8.1",
"concurrently": "^5.3.0",
"cypress": "^5.6.0",
"es-check": "^5.1.4",
"eslint": "^7.14.0",
"es-check": "^5.2.3",
"eslint": "^7.25.0",
"gzip-size": "^5.1.1",
"husky": "^4.3.0",
"husky": "^4.3.8",
"idtoken-verifier": "^2.1.0",
"jest": "^26.6.3",
"jest-junit": "^12.0.0",
"jest-localstorage-mock": "^2.4.3",
"jest-localstorage-mock": "^2.4.10",
"jsonwebtoken": "^8.5.1",

@@ -63,3 +63,3 @@ "pem": "^1.14.4",

"rimraf": "^3.0.2",
"rollup": "^2.34.1",
"rollup": "^2.45.2",
"rollup-plugin-analyzer": "^3.3.0",

@@ -73,16 +73,17 @@ "rollup-plugin-commonjs": "^10.1.0",

"rollup-plugin-typescript2": "^0.27.3",
"rollup-plugin-visualizer": "^4.2.0",
"rollup-plugin-web-worker-loader": "^1.5.0",
"rollup-plugin-visualizer": "^4.2.2",
"rollup-plugin-web-worker-loader": "^1.6.1",
"serve": "^11.3.2",
"ts-jest": "^26.4.4",
"ts-jest": "^26.5.5",
"tslib": "^2.2.0",
"tslint": "^6.1.3",
"tslint-config-security": "^1.16.0",
"typedoc": "^0.18.0",
"typescript": "^4.1.2",
"wait-on": "^5.2.1"
"typescript": "^4.2.4",
"wait-on": "^5.3.0"
},
"dependencies": {
"abortcontroller-polyfill": "^1.5.0",
"browser-tabs-lock": "1.2.9",
"core-js": "^3.8.0",
"abortcontroller-polyfill": "^1.7.1",
"browser-tabs-lock": "^1.2.13",
"core-js": "^3.11.0",
"es-cookie": "^1.3.2",

@@ -133,2 +134,2 @@ "fast-text-encoding": "^1.0.3",

}
}
}

@@ -240,5 +240,5 @@ # @auth0/auth0-spa-js

### Organizations (Closed Beta)
### Organizations
Organizations is a set of features that provide better support for developers who build and maintain SaaS and Business-to-Business (B2B) applications.
[Organizations](https://auth0.com/docs/organizations) is a set of features that provide better support for developers who build and maintain SaaS and Business-to-Business (B2B) applications.

@@ -245,0 +245,0 @@ Using Organizations, you can:

@@ -12,3 +12,4 @@ import Lock from 'browser-tabs-lock';

bufferToBase64UrlEncoded,
validateCrypto
validateCrypto,
openPopup
} from './utils';

@@ -323,3 +324,9 @@

* ```js
* await auth0.loginWithPopup(options);
* try {
* await auth0.loginWithPopup(options);
* } catch(e) {
* if (e instanceof PopupCancelledError) {
* // Popup was closed before login completed
* }
* }
* ```

@@ -340,5 +347,12 @@ *

public async loginWithPopup(
options: PopupLoginOptions = {},
config: PopupConfigOptions = {}
options?: PopupLoginOptions,
config?: PopupConfigOptions
) {
options = options || {};
config = config || {};
if (!config.popup) {
config.popup = openPopup('');
}
const { ...authorizeOptions } = options;

@@ -364,3 +378,5 @@ const stateIn = encode(createRandomString());

const codeResult = await runPopup(url, {
config.popup.location.href = url;
const codeResult = await runPopup({
...config,

@@ -427,3 +443,3 @@ timeoutInSeconds:

*
* @typeparam TUser The type to return, has to extend {@link User}.
* @typeparam TUser The type to return, has to extend {@link User}.
* @param options

@@ -461,3 +477,5 @@ */

*/
public async getIdTokenClaims(options: GetIdTokenClaimsOptions = {}): Promise<IdToken> {
public async getIdTokenClaims(
options: GetIdTokenClaimsOptions = {}
): Promise<IdToken> {
const audience = options.audience || this.options.audience || 'default';

@@ -838,4 +856,4 @@ const scope = getUniqueScopes(this.defaultScope, this.scope, options.scope);

options.redirect_uri ||
this.options.redirect_uri ||
window.location.origin
this.options.redirect_uri ||
window.location.origin
);

@@ -842,0 +860,0 @@

@@ -61,1 +61,9 @@ /**

}
export class PopupCancelledError extends GenericError {
constructor(public popup: Window) {
super('cancelled', 'Popup closed');
//https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work
Object.setPrototypeOf(this, PopupCancelledError.prototype);
}
}

@@ -79,3 +79,3 @@ /**

/**
* The Id of an organization to log in to (Organizations is currently a Closed Beta).
* The Id of an organization to log in to.
*

@@ -82,0 +82,0 @@ * This will specify an `organization` parameter in your user's login request and will add a step to validate

@@ -30,3 +30,4 @@ import 'core-js/es/string/starts-with';

TimeoutError,
PopupTimeoutError
PopupTimeoutError,
PopupCancelledError
} from './errors';

@@ -8,3 +8,8 @@ import { AuthenticationResult, PopupConfigOptions } from './global';

import { PopupTimeoutError, TimeoutError, GenericError } from './errors';
import {
PopupTimeoutError,
TimeoutError,
GenericError,
PopupCancelledError
} from './errors';

@@ -84,3 +89,3 @@ export const parseQueryResult = (queryString: string) => {

const openPopup = (url: string) => {
export const openPopup = (url: string) => {
const width = 400;

@@ -98,20 +103,19 @@ const height = 600;

export const runPopup = (authorizeUrl: string, config: PopupConfigOptions) => {
let popup = config.popup;
if (popup) {
popup.location.href = authorizeUrl;
} else {
popup = openPopup(authorizeUrl);
}
if (!popup) {
throw new Error('Could not open popup');
}
export const runPopup = (config: PopupConfigOptions) => {
return new Promise<AuthenticationResult>((resolve, reject) => {
let popupEventListener: EventListenerOrEventListenerObject;
// Check each second if the popup is closed triggering a PopupCancelledError
const popupTimer = setInterval(() => {
if (config.popup && config.popup.closed) {
clearInterval(popupTimer);
clearTimeout(timeoutId);
window.removeEventListener('message', popupEventListener, false);
reject(new PopupCancelledError(config.popup));
}
}, 1000);
const timeoutId = setTimeout(() => {
reject(new PopupTimeoutError(popup));
clearInterval(popupTimer);
reject(new PopupTimeoutError(config.popup));
window.removeEventListener('message', popupEventListener, false);

@@ -126,4 +130,5 @@ }, (config.timeoutInSeconds || DEFAULT_AUTHORIZE_TIMEOUT_IN_SECONDS) * 1000);

clearTimeout(timeoutId);
clearInterval(popupTimer);
window.removeEventListener('message', popupEventListener, false);
popup.close();
config.popup.close();

@@ -130,0 +135,0 @@ if (e.data.response.error) {

@@ -1,1 +0,1 @@

export default '1.14.0';
export default '1.15.0';

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

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc