Add SAML support

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2025-10-29 18:42:12 +01:00
parent 3018a3e691
commit 2766f8e423
97 changed files with 14824 additions and 2812 deletions

View File

@@ -2,6 +2,7 @@ import { useLocation, useRouteError } from "react-router";
import { IconPageCross } from "@probo/ui";
import { useTranslate } from "@probo/i18n";
import { useEffect, useRef } from "react";
import { AuthenticationRequiredError } from "/providers/RelayProviders";
const classNames = {
wrapper: "py-10 text-center space-y-2 ",
@@ -32,6 +33,27 @@ export function PageError({ resetErrorBoundary, error: propsError }: Props) {
}
}, [location, resetErrorBoundary]);
useEffect(() => {
if (error instanceof AuthenticationRequiredError) {
window.location.href = error.redirectUrl;
}
}, [error]);
if (error instanceof AuthenticationRequiredError) {
return (
<div className={classNames.wrapper}>
<h1 className={classNames.title}>
{__("Additional authentication required")}
</h1>
<p className={classNames.description}>
{error.requiresSaml
? __("Redirecting to SAML authentication...")
: __("Redirecting to login...")}
</p>
</div>
);
}
if (!error || (error && error.toString().includes("PAGE_NOT_FOUND"))) {
return (
<div className={classNames.wrapper}>