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