mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-04-19 12:59:12 +01:00
Fix redirect URI for localhost
This commit is contained in:
@@ -50,7 +50,10 @@ export function decryptJWTToken(token: string) {
|
|||||||
|
|
||||||
export async function getMsalInstance() {
|
export async function getMsalInstance() {
|
||||||
// Compute the redirect bridge URL for MSAL v5 COOP handling
|
// Compute the redirect bridge URL for MSAL v5 COOP handling
|
||||||
const redirectBridgeUrl = `${window.location.origin}/redirectBridge.html`;
|
const redirectBridgeUrl =
|
||||||
|
process.env.NODE_ENV === "development"
|
||||||
|
? "https://dataexplorer-dev.azurewebsites.net/redirectBridge.html"
|
||||||
|
: `${window.location.origin}/redirectBridge.html`;
|
||||||
|
|
||||||
const msalConfig: msal.Configuration = {
|
const msalConfig: msal.Configuration = {
|
||||||
cache: {
|
cache: {
|
||||||
@@ -64,7 +67,7 @@ export async function getMsalInstance() {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (process.env.NODE_ENV === "development" && !window.location.hostname.includes("localhost")) {
|
if (process.env.NODE_ENV === "development") {
|
||||||
msalConfig.auth.redirectUri = "https://dataexplorer-dev.azurewebsites.net/redirectBridge.html";
|
msalConfig.auth.redirectUri = "https://dataexplorer-dev.azurewebsites.net/redirectBridge.html";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,9 +58,11 @@ export function useAADAuth(config?: ConfigContext): ReturnType {
|
|||||||
if (!msalInstance || !config) {
|
if (!msalInstance || !config) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use redirect bridge for MSAL v5 COOP handling (CG alert MVS-2026-vmmw-f85q)
|
// Use redirect bridge for MSAL v5 COOP handling (CG alert MVS-2026-vmmw-f85q)
|
||||||
const redirectBridgeUrl = `${window.location.origin}/redirectBridge.html`;
|
const redirectBridgeUrl =
|
||||||
|
process.env.NODE_ENV === "development"
|
||||||
|
? "https://dataexplorer-dev.azurewebsites.net/redirectBridge.html"
|
||||||
|
: `${window.location.origin}/redirectBridge.html`;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await msalInstance.loginPopup({
|
const response = await msalInstance.loginPopup({
|
||||||
@@ -93,7 +95,10 @@ export function useAADAuth(config?: ConfigContext): ReturnType {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Use redirect bridge for MSAL v5 COOP handling (CG alert MVS-2026-vmmw-f85q)
|
// Use redirect bridge for MSAL v5 COOP handling (CG alert MVS-2026-vmmw-f85q)
|
||||||
const redirectBridgeUrl = `${window.location.origin}/redirectBridge.html`;
|
const redirectBridgeUrl =
|
||||||
|
process.env.NODE_ENV === "development"
|
||||||
|
? "https://dataexplorer-dev.azurewebsites.net/redirectBridge.html"
|
||||||
|
: `${window.location.origin}/redirectBridge.html`;
|
||||||
try {
|
try {
|
||||||
const response = await msalInstance.loginPopup({
|
const response = await msalInstance.loginPopup({
|
||||||
redirectUri: redirectBridgeUrl,
|
redirectUri: redirectBridgeUrl,
|
||||||
|
|||||||
Reference in New Issue
Block a user