ui -set custom base url and logout url

This commit is contained in:
Ishaan Jaff 2024-06-07 19:00:09 -07:00
parent 366fc5e40b
commit fad063df6e
5 changed files with 101 additions and 10 deletions

View file

@ -2382,3 +2382,40 @@ export const healthCheckCall = async (accessToken: String) => {
throw error;
}
};
export const getProxyBaseUrlAndLogoutUrl = async (
accessToken: String,
) => {
/**
* Get all the models user has access to
*/
try {
let url = proxyBaseUrl
? `${proxyBaseUrl}/sso/get/logout_url`
: `/sso/get/logout_url`;
//message.info("Requesting model data");
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: `Bearer ${accessToken}`,
"Content-Type": "application/json",
},
});
if (!response.ok) {
const errorData = await response.text();
message.error(errorData, 10);
throw new Error("Network response was not ok");
}
const data = await response.json();
//message.info("Received model data");
return data;
// Handle success - you might want to update some state or UI based on the created key
} catch (error) {
console.error("Failed to get callbacks:", error);
throw error;
}
};