@@ -23,10 +23,7 @@ export default function AuthRedirect({ children }: Props) {
|
||||
const isUnauthenticated = status === "unauthenticated";
|
||||
const isPublicPage = router.pathname.startsWith("/public");
|
||||
const hasInactiveSubscription =
|
||||
user.id &&
|
||||
!user.subscription?.active &&
|
||||
!user.parentSubscription?.active &&
|
||||
stripeEnabled;
|
||||
user.id && !user.subscription?.active && stripeEnabled;
|
||||
|
||||
// There are better ways of doing this... but this one works for now
|
||||
const routes = [
|
||||
@@ -52,8 +49,6 @@ export default function AuthRedirect({ children }: Props) {
|
||||
} else {
|
||||
if (isLoggedIn && hasInactiveSubscription) {
|
||||
redirectTo("/subscribe");
|
||||
} else if (isLoggedIn && !user.name && user.parentSubscriptionId) {
|
||||
redirectTo("/member-onboarding");
|
||||
} else if (
|
||||
isLoggedIn &&
|
||||
!routes.some((e) => router.pathname.startsWith(e.path) && e.isProtected)
|
||||
|
||||
Reference in New Issue
Block a user