@pega/auth
Advanced tools
Comparing version 0.2.11 to 0.2.12
@@ -17,2 +17,3 @@ /** | ||
* locale - use a specific locale override (possibly different than locale specified in operator record) (default: null) | ||
* additionalHeaders - object with attribute names correlating to additional headers and values being the header values (default:null) | ||
*/ | ||
@@ -19,0 +20,0 @@ export declare const loginIfNecessary: (loginProps: any) => void; |
@@ -39,2 +39,4 @@ // This file wraps various calls related to logging in, logging out, etc. | ||
#loadUserinfo = false; | ||
// Keep loginProps passed to loginIfNecessary | ||
#loginProps = null; | ||
constructor() { | ||
@@ -504,2 +506,7 @@ // Auth Manager specific state is saved within session storage as important in redirect and popup window scenarios | ||
} | ||
// Set additional headers if specified | ||
const additionalHeaders = this.#loginProps.additionalHeaders; | ||
if (additionalHeaders) { | ||
constellationBootConfig.additionalHeaders = additionalHeaders; | ||
} | ||
if (this.bC11NBootstrapInProgress) { | ||
@@ -625,5 +632,9 @@ return; | ||
const arExcludedPortals = serverConfig.excludePortals; | ||
const additionalHeaders = this.#loginProps.additionalHeaders || {}; | ||
const oHeaders = this.#authHeader | ||
? { Authorization: this.#authHeader, ...additionalHeaders } | ||
: additionalHeaders; | ||
const headers = { | ||
Authorization: this.#authHeader === null ? '' : this.#authHeader, | ||
'Content-Type': 'application/json' | ||
'Content-Type': 'application/json', | ||
...oHeaders | ||
}; | ||
@@ -634,3 +645,4 @@ // Using v1 API here as v2 data_views is not able to access same data page currently. Should move to avoid having this logic to find | ||
method: 'GET', | ||
headers | ||
headers, | ||
credentials: this.#authConfig.secureCookie ? 'include' : 'omit' | ||
}) | ||
@@ -806,2 +818,3 @@ .then(response => { | ||
const { appName, deferLogin, redirectDoneCB, locale } = loginProps; | ||
this.#loginProps = { ...loginProps }; | ||
const noMainRedirect = !loginProps.mainRedirect; | ||
@@ -937,2 +950,3 @@ // We need to load state before making any decisions | ||
* locale - use a specific locale override (possibly different than locale specified in operator record) (default: null) | ||
* additionalHeaders - object with attribute names correlating to additional headers and values being the header values (default:null) | ||
*/ | ||
@@ -939,0 +953,0 @@ export const loginIfNecessary = (loginProps) => { |
{ | ||
"name": "@pega/auth", | ||
"version": "0.2.11", | ||
"version": "0.2.12", | ||
"description": "Pega OAuth 2.0 Client Library (supports Infinity and Launchpad).", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
202671
2226