mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-04-17 03:49:23 +01:00
Fix MPAC redirect URL (#2456)
* Fix MPAC redirect URL * Address comment
This commit is contained in:
@@ -50,12 +50,25 @@ export function decryptJWTToken(token: string) {
|
||||
return JSON.parse(tokenPayload);
|
||||
}
|
||||
|
||||
export function getRedirectBridgeUrl(): string {
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
return "https://dataexplorer-dev.azurewebsites.net/redirectBridge.html";
|
||||
}
|
||||
const basePath = window.location.pathname.startsWith("/mpac/") ? "/mpac" : "";
|
||||
return `${window.location.origin}${basePath}/redirectBridge.html`;
|
||||
}
|
||||
|
||||
export function getPostLogoutRedirectUrl(): string {
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
return "https://dataexplorer-dev.azurewebsites.net/hostedExplorer.html";
|
||||
}
|
||||
const basePath = window.location.pathname.startsWith("/mpac/") ? "/mpac" : "";
|
||||
return `${window.location.origin}${basePath}`;
|
||||
}
|
||||
|
||||
export async function getMsalInstance() {
|
||||
// Compute the redirect bridge URL for MSAL v5 COOP handling
|
||||
const redirectBridgeUrl =
|
||||
process.env.NODE_ENV === "development"
|
||||
? "https://dataexplorer-dev.azurewebsites.net/redirectBridge.html"
|
||||
: `${window.location.origin}/redirectBridge.html`;
|
||||
const redirectBridgeUrl = getRedirectBridgeUrl();
|
||||
|
||||
const msalConfig: msal.Configuration = {
|
||||
cache: {
|
||||
|
||||
Reference in New Issue
Block a user