mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-11-08 04:31:03 +00:00
fix: pre-emptive render without valid user
This commit is contained in:
1 parent
b7429e47b0
commit
c96b09bb81
1 file changed
+1
-1
@@ -13,7 +13,7 @@ interface Props {
|
||||
export const CheckAuth = (props: Props) => {
|
||||
const auth = useApplicationState().auth;
|
||||
const client = useClient();
|
||||
const ready = auth.isLoggedIn() && typeof client?.user !== "undefined";
|
||||
const ready = auth.isLoggedIn() && !!client?.user;
|
||||
|
||||
if (props.auth && !ready) {
|
||||
return <Redirect to="/login" />;
|
||||
|
||||
Reference in new issue
Block a user