mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-23 04:21:52 +00:00
chore(ui): add SessionError type
This commit is contained in:
@@ -15,10 +15,12 @@ export const redirectToSignIn = async (): Promise<never> => {
|
||||
redirect(`/sign-in?${searchParams.toString()}`);
|
||||
};
|
||||
|
||||
type SessionError = "RefreshAccessTokenError" | (string & {});
|
||||
|
||||
export const getRequiredAuthHeaders = async (
|
||||
accessToken: string | undefined,
|
||||
options?: { contentType?: boolean },
|
||||
sessionError?: string,
|
||||
sessionError?: SessionError,
|
||||
) => {
|
||||
if (!accessToken || sessionError === "RefreshAccessTokenError") {
|
||||
return redirectToSignIn();
|
||||
|
||||
Reference in New Issue
Block a user