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:
Tim Chamberlain
2022-08-09 11:52:32 -05:00
parent c4b72c4b11
commit 7cb3c5ee88
12 changed files with 81 additions and 104 deletions

View 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>
);
}