@nsshunt/stsoauth2plugin 1.0.169 → 1.0.170
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/index.cjs
CHANGED
|
@@ -26,7 +26,6 @@ let vue = require("vue");
|
|
|
26
26
|
let node_worker_threads = require("node:worker_threads");
|
|
27
27
|
node_worker_threads = __toESM(node_worker_threads);
|
|
28
28
|
let _nsshunt_stsutils = require("@nsshunt/stsutils");
|
|
29
|
-
let _nsshunt_stsauthclient = require("@nsshunt/stsauthclient");
|
|
30
29
|
let _nsshunt_stsvueutils = require("@nsshunt/stsvueutils");
|
|
31
30
|
let pinia = require("pinia");
|
|
32
31
|
let _nsshunt_stsinstrumentmanagerclient = require("@nsshunt/stsinstrumentmanagerclient");
|
|
@@ -662,7 +661,7 @@ var STSOAuth2Manager = class {
|
|
|
662
661
|
return;
|
|
663
662
|
}
|
|
664
663
|
const str = to.query;
|
|
665
|
-
if (str[
|
|
664
|
+
if (str[OAuth2ParameterType.CODE] || str[OAuth2ParameterType.ERROR]) {
|
|
666
665
|
this.#LogDebugMessage(chalk.magenta(`STSOAuth2Manager:#SetupRoute:Processing redirect: [${JSON.stringify(str)}]`));
|
|
667
666
|
const retVal = await oAuth2Manager.HandleRedirect(str);
|
|
668
667
|
this.#LogDebugMessage(chalk.magenta(`STSOAuth2Manager:#SetupRoute:Redirect result: [${retVal}]`));
|
|
@@ -755,7 +754,7 @@ var STSOAuth2Manager = class {
|
|
|
755
754
|
try {
|
|
756
755
|
this.#LogDebugMessage(chalk.magenta(`STSOAuth2Manager:HandleRedirect`));
|
|
757
756
|
let response = null;
|
|
758
|
-
if (queryVars[
|
|
757
|
+
if (queryVars[OAuth2ParameterType.CODE]) {
|
|
759
758
|
const authorizeOptions = this.#transactionStore.get(this.#STORAGE_AUTHORIZE_OPTIONS_KEY);
|
|
760
759
|
this.#transactionStore.remove(this.#STORAGE_AUTHORIZE_OPTIONS_KEY);
|
|
761
760
|
this.#LogDebugMessage(chalk.magenta(`STSOAuth2Manager:HandleRedirect: sending HANDLE_REDIRECT command`));
|
|
@@ -1825,10 +1824,10 @@ var STSOAuth2Worker = class {
|
|
|
1825
1824
|
this.#LogMessage(url);
|
|
1826
1825
|
try {
|
|
1827
1826
|
const rConfig = new _nsshunt_stsutils.STSAxiosConfig(url, "post").withData({
|
|
1828
|
-
[
|
|
1829
|
-
[
|
|
1830
|
-
[
|
|
1831
|
-
[
|
|
1827
|
+
[OAuth2ParameterType.CLIENT_ID]: this.#options.client_id,
|
|
1828
|
+
[OAuth2ParameterType.SCOPE]: this.#options.scope,
|
|
1829
|
+
[OAuth2ParameterType.REDIRECT_URI]: this.#options.redirect_uri,
|
|
1830
|
+
[OAuth2ParameterType.AUDIENCE]: this.#options.audience
|
|
1832
1831
|
}).withDefaultHeaders().withCredentials().withTimeout(this.#options.timeout);
|
|
1833
1832
|
this.#LogDebugMessage(chalk.magenta(`#RestoreSession:session request detail: [${JSON.stringify(rConfig)}]`));
|
|
1834
1833
|
if (_nsshunt_stsutils.isNode && this.#agentManager) rConfig.withAgentManager(this.#agentManager);
|
|
@@ -1900,7 +1899,7 @@ var STSOAuth2Worker = class {
|
|
|
1900
1899
|
const authorizeOptions = payload.authorizeOptions;
|
|
1901
1900
|
this.#LogDebugMessage(chalk.magenta(`#HandleRedirect: HandleRedirect`));
|
|
1902
1901
|
this.#LogDebugMessage(chalk.magenta(`#HandleRedirect: HandleRedirect:Query Vars: [${JSON.stringify(queryVars)}]`));
|
|
1903
|
-
if (queryVars[
|
|
1902
|
+
if (queryVars[OAuth2ParameterType.CODE]) {
|
|
1904
1903
|
const response = queryVars;
|
|
1905
1904
|
this.#LogInfoMessage(`authorizeOptions from transaction state: [${JSON.stringify(authorizeOptions)}]`);
|
|
1906
1905
|
const redirectState = response.state;
|
|
@@ -1915,7 +1914,7 @@ var STSOAuth2Worker = class {
|
|
|
1915
1914
|
this.#HandleErrorEvent({ message: "State un-matched" });
|
|
1916
1915
|
return false;
|
|
1917
1916
|
}
|
|
1918
|
-
} else if (queryVars[
|
|
1917
|
+
} else if (queryVars[OAuth2ParameterType.ERROR]) {
|
|
1919
1918
|
this.#LogErrorMessage(chalk.red(`State un-matched (1)`));
|
|
1920
1919
|
this.#HandleErrorEvent({ message: "State un-matched" });
|
|
1921
1920
|
return false;
|