mirror of
https://github.com/Kingsrook/qqq-frontend-material-dashboard.git
synced 2025-07-18 05:10:45 +00:00
QQQ-32: added booleans, cleaned up error handling, fixed infinite loop on unauthorized login, removed all the login buttons, removed redundant qClient functions
This commit is contained in:
29
src/HandleAuthorizationError.tsx
Normal file
29
src/HandleAuthorizationError.tsx
Normal file
@ -0,0 +1,29 @@
|
||||
import React, {
|
||||
useState,
|
||||
useEffect,
|
||||
JSXElementConstructor,
|
||||
Key,
|
||||
ReactElement,
|
||||
} from "react";
|
||||
import {SESSION_ID_COOKIE_NAME} from "App";
|
||||
import {useCookies} from "react-cookie";
|
||||
import {QTableMetaData} from "@kingsrook/qqq-frontend-core/lib/model/metaData/QTableMetaData";
|
||||
|
||||
interface Props
|
||||
{
|
||||
errorMessage?: string;
|
||||
}
|
||||
|
||||
export default function HandleAuthorizationError({errorMessage}: Props)
|
||||
{
|
||||
const [, , removeCookie] = useCookies([SESSION_ID_COOKIE_NAME]);
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
removeCookie(SESSION_ID_COOKIE_NAME, {path: "/"});
|
||||
});
|
||||
|
||||
return (
|
||||
<div>{errorMessage}</div>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user