remove beta user check
This commit is contained in:
@@ -8,9 +8,5 @@ export default async function Home() {
|
||||
redirect("/login");
|
||||
}
|
||||
|
||||
if (!session.user.isBetaUser) {
|
||||
redirect("/wait-list");
|
||||
} else {
|
||||
redirect("/dashboard");
|
||||
}
|
||||
redirect("/dashboard");
|
||||
}
|
||||
|
@@ -35,19 +35,5 @@ const AppAuthProvider = ({ children }: { children: React.ReactNode }) => {
|
||||
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}</>;
|
||||
};
|
||||
|
@@ -99,7 +99,7 @@ export const publicProcedure = t.procedure;
|
||||
* @see https://trpc.io/docs/procedures
|
||||
*/
|
||||
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" });
|
||||
}
|
||||
|
||||
|
@@ -126,17 +126,10 @@ export const authOptions: NextAuthOptions = {
|
||||
invitesAvailable = invites.length > 0;
|
||||
}
|
||||
|
||||
// No waitlist for self hosting
|
||||
if (
|
||||
!env.NEXT_PUBLIC_IS_CLOUD ||
|
||||
env.NODE_ENV === "development" ||
|
||||
invitesAvailable
|
||||
) {
|
||||
await db.user.update({
|
||||
where: { id: user.id },
|
||||
data: { isBetaUser: true },
|
||||
});
|
||||
}
|
||||
await db.user.update({
|
||||
where: { id: user.id },
|
||||
data: { isBetaUser: true },
|
||||
});
|
||||
},
|
||||
},
|
||||
providers: getProviders(),
|
||||
|
Reference in New Issue
Block a user