mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 09:25:27 +00:00
fix(invite): allow logged out users to view invites
This commit is contained in:
@@ -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="/" />;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user