remove beta user check

This commit is contained in:
KM Koushik
2025-09-09 07:40:53 +10:00
parent 292048d2c9
commit dd09217e36
4 changed files with 6 additions and 31 deletions

View File

@@ -8,9 +8,5 @@ export default async function Home() {
redirect("/login"); redirect("/login");
} }
if (!session.user.isBetaUser) {
redirect("/wait-list");
} else {
redirect("/dashboard"); redirect("/dashboard");
} }
}

View File

@@ -35,19 +35,5 @@ const AppAuthProvider = ({ children }: { children: React.ReactNode }) => {
return <LoginPage />; return <LoginPage />;
} }
if (!session.user.isBetaUser) {
return (
<div className="flex items-center justify-center min-h-screen ">
<div className="p-8 shadow-lg rounded-lg flex flex-col gap-4">
<Rocket />
<h1 className="text-2xl font-bold">You're on the Waitlist!</h1>
<p className=" text-secondary-muted">
Hang tight, we'll get to you as soon as possible.
</p>
</div>
</div>
);
}
return <>{children}</>; return <>{children}</>;
}; };

View File

@@ -99,7 +99,7 @@ export const publicProcedure = t.procedure;
* @see https://trpc.io/docs/procedures * @see https://trpc.io/docs/procedures
*/ */
export const protectedProcedure = t.procedure.use(({ ctx, next }) => { export const protectedProcedure = t.procedure.use(({ ctx, next }) => {
if (!ctx.session || !ctx.session.user || !ctx.session.user.isBetaUser) { if (!ctx.session || !ctx.session.user) {
throw new TRPCError({ code: "UNAUTHORIZED" }); throw new TRPCError({ code: "UNAUTHORIZED" });
} }

View File

@@ -126,17 +126,10 @@ export const authOptions: NextAuthOptions = {
invitesAvailable = invites.length > 0; invitesAvailable = invites.length > 0;
} }
// No waitlist for self hosting
if (
!env.NEXT_PUBLIC_IS_CLOUD ||
env.NODE_ENV === "development" ||
invitesAvailable
) {
await db.user.update({ await db.user.update({
where: { id: user.id }, where: { id: user.id },
data: { isBetaUser: true }, data: { isBetaUser: true },
}); });
}
}, },
}, },
providers: getProviders(), providers: getProviders(),