mirror of
https://github.com/revoltchat/revite.git
synced 2024-12-26 23:42:11 -05:00
fix: pre-emptive render without valid user
This commit is contained in:
parent
b7429e47b0
commit
c96b09bb81
1 changed files with 1 additions and 1 deletions
|
@ -13,7 +13,7 @@ interface Props {
|
||||||
export const CheckAuth = (props: Props) => {
|
export const CheckAuth = (props: Props) => {
|
||||||
const auth = useApplicationState().auth;
|
const auth = useApplicationState().auth;
|
||||||
const client = useClient();
|
const client = useClient();
|
||||||
const ready = auth.isLoggedIn() && typeof client?.user !== "undefined";
|
const ready = auth.isLoggedIn() && !!client?.user;
|
||||||
|
|
||||||
if (props.auth && !ready) {
|
if (props.auth && !ready) {
|
||||||
return <Redirect to="/login" />;
|
return <Redirect to="/login" />;
|
||||||
|
|
Loading…
Reference in a new issue