fix(invite): allow logged out users to view invites

This commit is contained in:
Paul Makles
2021-12-28 12:24:35 +00:00
parent ce3be17b74
commit b5077b62ff
4 changed files with 19 additions and 10 deletions

View File

@@ -7,6 +7,8 @@ import { useClient } from "./RevoltClient";
interface Props {
auth?: boolean;
blockRender?: boolean;
children: Children;
}
@@ -16,8 +18,10 @@ export const CheckAuth = (props: Props) => {
const ready = auth.isLoggedIn() && !!client?.user;
if (props.auth && !ready) {
if (props.blockRender) return null;
return <Redirect to="/login" />;
} else if (!props.auth && ready) {
if (props.blockRender) return null;
return <Redirect to="/" />;
}