@auth0/auth0-spa-js 2.0.1 → 2.0.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/dist/auth0-spa-js.development.js +11 -14
- package/dist/auth0-spa-js.development.js.map +1 -1
- package/dist/auth0-spa-js.production.esm.js +1 -1
- package/dist/auth0-spa-js.production.esm.js.map +1 -1
- package/dist/auth0-spa-js.production.js +1 -1
- package/dist/auth0-spa-js.production.js.map +1 -1
- package/dist/lib/auth0-spa-js.cjs.js +11 -14
- package/dist/lib/auth0-spa-js.cjs.js.map +1 -1
- package/dist/typings/utils.d.ts +1 -1
- package/dist/typings/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/Auth0Client.ts +2 -2
- package/src/utils.ts +11 -14
- package/src/version.ts +1 -1
package/dist/typings/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AuthenticationResult, PopupConfigOptions } from './global';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const parseAuthenticationResult: (queryString: string) => AuthenticationResult;
|
|
3
3
|
export declare const runIframe: (authorizeUrl: string, eventOrigin: string, timeoutInSeconds?: number) => Promise<AuthenticationResult>;
|
|
4
4
|
export declare const openPopup: (url: string) => Window | null;
|
|
5
5
|
export declare const runPopup: (config: PopupConfigOptions) => Promise<AuthenticationResult>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "2.0.
|
|
1
|
+
declare const _default: "2.0.2";
|
|
2
2
|
export default _default;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "@auth0/auth0-spa-js",
|
|
4
4
|
"description": "Auth0 SDK for Single Page Applications using Authorization Code Grant Flow with PKCE",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "2.0.
|
|
6
|
+
"version": "2.0.2",
|
|
7
7
|
"main": "dist/lib/auth0-spa-js.cjs.js",
|
|
8
8
|
"types": "dist/typings/index.d.ts",
|
|
9
9
|
"module": "dist/auth0-spa-js.production.esm.js",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"jest-fetch-mock": "^3.0.3",
|
|
59
59
|
"jest-junit": "^14.0.0",
|
|
60
60
|
"jest-localstorage-mock": "^2.4.22",
|
|
61
|
-
"jsonwebtoken": "^
|
|
61
|
+
"jsonwebtoken": "^9.0.0",
|
|
62
62
|
"node-fetch": "^3.2.10",
|
|
63
63
|
"oidc-provider": "^7.14.0",
|
|
64
64
|
"prettier": "^2.7.1",
|
package/src/Auth0Client.ts
CHANGED
|
@@ -3,7 +3,7 @@ import Lock from 'browser-tabs-lock';
|
|
|
3
3
|
import {
|
|
4
4
|
createQueryParams,
|
|
5
5
|
runPopup,
|
|
6
|
-
|
|
6
|
+
parseAuthenticationResult,
|
|
7
7
|
encode,
|
|
8
8
|
createRandomString,
|
|
9
9
|
runIframe,
|
|
@@ -486,7 +486,7 @@ export class Auth0Client {
|
|
|
486
486
|
throw new Error('There are no query params available for parsing.');
|
|
487
487
|
}
|
|
488
488
|
|
|
489
|
-
const { state, code, error, error_description } =
|
|
489
|
+
const { state, code, error, error_description } = parseAuthenticationResult(
|
|
490
490
|
queryStringFragments.join('')
|
|
491
491
|
);
|
|
492
492
|
|
package/src/utils.ts
CHANGED
|
@@ -12,24 +12,21 @@ import {
|
|
|
12
12
|
PopupCancelledError
|
|
13
13
|
} from './errors';
|
|
14
14
|
|
|
15
|
-
export const
|
|
15
|
+
export const parseAuthenticationResult = (
|
|
16
|
+
queryString: string
|
|
17
|
+
): AuthenticationResult => {
|
|
16
18
|
if (queryString.indexOf('#') > -1) {
|
|
17
|
-
queryString = queryString.
|
|
19
|
+
queryString = queryString.substring(0, queryString.indexOf('#'));
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
const
|
|
21
|
-
const parsedQuery: Record<string, any> = {};
|
|
22
|
+
const searchParams = new URLSearchParams(queryString);
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
parsedQuery.expires_in = parseInt(parsedQuery.expires_in);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return parsedQuery as AuthenticationResult;
|
|
24
|
+
return {
|
|
25
|
+
state: searchParams.get('state')!,
|
|
26
|
+
code: searchParams.get('code') || undefined,
|
|
27
|
+
error: searchParams.get('error') || undefined,
|
|
28
|
+
error_description: searchParams.get('error_description') || undefined
|
|
29
|
+
};
|
|
33
30
|
};
|
|
34
31
|
|
|
35
32
|
export const runIframe = (
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '2.0.
|
|
1
|
+
export default '2.0.2';
|