Improve check user exists (#25057)

This commit is contained in:
Volnei Munhoz
2025-11-11 06:05:37 +00:00
committed by GitHub
parent 228fbaf72e
commit 53a931da4e
@@ -39,7 +39,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
},
};
}
} catch (e) {
} catch {
return {
redirect: {
destination: "/auth/error?error=Invalid%20JWT%3A%20Please%20try%20again",
@@ -76,8 +76,8 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
};
}
const userCount = await prisma.user.count();
if (userCount === 0) {
const userExists = await prisma.user.findFirst({ select: { id: true } });
if (!userExists) {
// Proceed to new onboarding to create first admin user
return {
redirect: {