fix minor auth issues and set NODE_ENV to solve react email bug

This commit is contained in:
Milo Schwartz
2024-11-27 14:35:38 -05:00
parent 8178dd1525
commit c2cbd7e1a1
10 changed files with 75 additions and 90 deletions

View File

@@ -165,14 +165,14 @@ export default function ResourceAuthPortal(props: ResourceAuthPortalProps) {
};
async function handleSSOAuth() {
console.log("SSO authentication");
await api.get(`/resource/${props.resource.id}`).catch((e) => {
try {
await api.get(`/resource/${props.resource.id}`);
} catch (e) {
setAccessDenied(true);
});
}
if (!accessDenied) {
window.location.href = props.redirect;
window.location.href = constructRedirect(props.redirect);
}
}