@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
|
@@ -472,7 +472,7 @@
|
|
|
472
472
|
exports.default = SuperTokensLock;
|
|
473
473
|
}));
|
|
474
474
|
var Lock = unwrapExports(browserTabsLock);
|
|
475
|
-
var version = "2.0.
|
|
475
|
+
var version = "2.0.2";
|
|
476
476
|
const DEFAULT_AUTHORIZE_TIMEOUT_IN_SECONDS = 60;
|
|
477
477
|
const DEFAULT_POPUP_CONFIG_OPTIONS = {
|
|
478
478
|
timeoutInSeconds: DEFAULT_AUTHORIZE_TIMEOUT_IN_SECONDS
|
|
@@ -547,20 +547,17 @@
|
|
|
547
547
|
function valueOrEmptyString(value, exclude = []) {
|
|
548
548
|
return value && !exclude.includes(value) ? value : "";
|
|
549
549
|
}
|
|
550
|
-
const
|
|
550
|
+
const parseAuthenticationResult = queryString => {
|
|
551
551
|
if (queryString.indexOf("#") > -1) {
|
|
552
|
-
queryString = queryString.
|
|
552
|
+
queryString = queryString.substring(0, queryString.indexOf("#"));
|
|
553
553
|
}
|
|
554
|
-
const
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
parsedQuery.expires_in = parseInt(parsedQuery.expires_in);
|
|
562
|
-
}
|
|
563
|
-
return parsedQuery;
|
|
554
|
+
const searchParams = new URLSearchParams(queryString);
|
|
555
|
+
return {
|
|
556
|
+
state: searchParams.get("state"),
|
|
557
|
+
code: searchParams.get("code") || undefined,
|
|
558
|
+
error: searchParams.get("error") || undefined,
|
|
559
|
+
error_description: searchParams.get("error_description") || undefined
|
|
560
|
+
};
|
|
564
561
|
};
|
|
565
562
|
const runIframe = (authorizeUrl, eventOrigin, timeoutInSeconds = DEFAULT_AUTHORIZE_TIMEOUT_IN_SECONDS) => new Promise(((res, rej) => {
|
|
566
563
|
const iframe = window.document.createElement("iframe");
|
|
@@ -1557,7 +1554,7 @@
|
|
|
1557
1554
|
if (queryStringFragments.length === 0) {
|
|
1558
1555
|
throw new Error("There are no query params available for parsing.");
|
|
1559
1556
|
}
|
|
1560
|
-
const {state: state, code: code, error: error, error_description: error_description} =
|
|
1557
|
+
const {state: state, code: code, error: error, error_description: error_description} = parseAuthenticationResult(queryStringFragments.join(""));
|
|
1561
1558
|
const transaction = this.transactionManager.get();
|
|
1562
1559
|
if (!transaction) {
|
|
1563
1560
|
throw new Error("Invalid state");
|