Perf improvements and billing updates

This commit is contained in:
giancarlo
2024-03-26 16:49:11 +08:00
parent 8626ea30c7
commit 4032aed827
39 changed files with 1261 additions and 1090 deletions

View File

@@ -28,6 +28,7 @@ function AuthRedirectListener({
useEffect(() => {
// keep this running for the whole session unless the component was unmounted
const listener = client.auth.onAuthStateChange((_, user) => {
console.log(_, user);
// log user out if user is falsy
// and if the current path is a private route
const shouldRedirectUser = !user && isPrivateRoute(pathName);