Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,15 @@ function EngineInstanceLayoutContent(props: {
);
}

if (permission.status === 401 || permission.status === 500) {
if (permission.status === 500) {
return (
<EngineErrorPage rootPath={rootPath}>
<p> Engine Instance Could Not Be Reached </p>
</EngineErrorPage>
);
}

if (permission.status === 401) {
return (
<EngineErrorPage rootPath={rootPath}>
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,23 @@ export async function getEngineAccessPermission(params: {
authToken: string;
instanceUrl: string;
}) {
const res = await fetch(`${params.instanceUrl}auth/permissions/get-all`, {
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${params.authToken}`,
},
});
try {
const res = await fetch(`${params.instanceUrl}auth/permissions/get-all`, {
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${params.authToken}`,
},
});

return {
ok: res.ok, // has access if this is true
status: res.status,
};
return {
ok: res.ok, // has access if this is true
status: res.status,
};
} catch {
return {
ok: false,
status: 500,
};
}
}
Loading