before: createAuthMiddleware(async (ctx) => {
if (ctx.path === '/change-email') {
const newEmail = ctx.body.newEmail.toLowerCase();
const existingUser = await prisma.user.findUnique({
where: { email: newEmail },
select: { id: true },
});
if (existingUser) {
console.log(
before: createAuthMiddleware(async (ctx) => {
if (ctx.path === '/change-email') {
const newEmail = ctx.body.newEmail.toLowerCase();
const existingUser = await prisma.user.findUnique({
where: { email: newEmail },
select: { id: true },
});
if (existingUser) {
console.log(