Skip to content

Instantly share code, notes, and snippets.

@gabrielEloy
Last active July 4, 2021 18:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gabrielEloy/a5b96fea2c7cc5d94179e5de7495e5ce to your computer and use it in GitHub Desktop.
Save gabrielEloy/a5b96fea2c7cc5d94179e5de7495e5ce to your computer and use it in GitHub Desktop.
const router = useRouter();
useEffect(() => {
async function checkUser() {
const currentUser = await Parse.User.currentAsync();
if (!currentUser) {
router.push("/");
}
}
checkUser();
}, []);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment