Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

fix program/auth

Steven Tey270f873183db
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/auth.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/auth.tsx
index 583b3678f9..80a3aa4837 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/auth.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/auth.tsx
@@ -31,9 +31,7 @@ export default function ProgramAuth({ children }: { children: ReactNode }) {
return <LayoutLoader />;
}
- if (!defaultProgramId && partnersEnabled) redirect(`/${slug}/program/new`);
-
- if (!getPlanCapabilities(plan).canManageProgram) {
+ if (!partnersEnabled || !getPlanCapabilities(plan).canManageProgram) {
return (
<PageContent>
<PartnersUpgradeCTA />
@@ -41,5 +39,7 @@ export default function ProgramAuth({ children }: { children: ReactNode }) {
);
}
+ if (!defaultProgramId) redirect(`/${slug}/program/new`);
+
return children;
}