Switch accountrestrictions call to use new backend in MPAC. (#1868)

This commit is contained in:
jawelton74
2024-06-18 09:41:24 -07:00
committed by GitHub
parent e66c8a1b5c
commit 4d0b1a6db8
3 changed files with 9 additions and 2 deletions

View File

@@ -51,13 +51,18 @@ export const fetchEncryptedToken_ToBeDeprecated = async (connectionString: strin
export const isAccountRestrictedForConnectionStringLogin = async (connectionString: string): Promise<boolean> => {
const headers = new Headers();
headers.append(HttpHeaders.connectionString, connectionString);
const url = configContext.BACKEND_ENDPOINT + "/api/guest/accountrestrictions/checkconnectionstringlogin";
const backendEndpoint: string = useNewPortalBackendEndpoint(BackendApi.PortalSettings)
? configContext.PORTAL_BACKEND_ENDPOINT
: configContext.BACKEND_ENDPOINT;
const url = backendEndpoint + "/api/guest/accountrestrictions/checkconnectionstringlogin";
const response = await fetch(url, { headers, method: "POST" });
if (!response.ok) {
throw response;
}
return (await response.text()) === "True";
return (await response.text()).toLowerCase() === "true";
};
export const ConnectExplorer: React.FunctionComponent<Props> = ({