mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-04-14 16:50:04 +00:00
feat(ui): refreshToken implementation (#8864)
This commit is contained in:
@@ -35,6 +35,7 @@ export const SignInForm = ({
|
||||
|
||||
useEffect(() => {
|
||||
const samlError = searchParams.get("sso_saml_failed");
|
||||
const sessionError = searchParams.get("error");
|
||||
|
||||
if (samlError) {
|
||||
setTimeout(() => {
|
||||
@@ -46,6 +47,37 @@ export const SignInForm = ({
|
||||
});
|
||||
}, 100);
|
||||
}
|
||||
|
||||
if (sessionError) {
|
||||
setTimeout(() => {
|
||||
const errorMessages: Record<
|
||||
string,
|
||||
{ title: string; description: string }
|
||||
> = {
|
||||
RefreshAccessTokenError: {
|
||||
title: "Session Expired",
|
||||
description:
|
||||
"Your session has expired. Please sign in again to continue.",
|
||||
},
|
||||
MissingRefreshToken: {
|
||||
title: "Session Error",
|
||||
description:
|
||||
"There was a problem with your session. Please sign in again.",
|
||||
},
|
||||
};
|
||||
|
||||
const errorConfig = errorMessages[sessionError] || {
|
||||
title: "Authentication Error",
|
||||
description: "Please sign in again to continue.",
|
||||
};
|
||||
|
||||
toast({
|
||||
variant: "destructive",
|
||||
title: errorConfig.title,
|
||||
description: errorConfig.description,
|
||||
});
|
||||
}, 100);
|
||||
}
|
||||
}, [searchParams, toast]);
|
||||
|
||||
const form = useForm<SignInFormData>({
|
||||
|
||||
Reference in New Issue
Block a user