mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-22 03:35:11 +02:00
fix issues from test deploy
This commit is contained in:
parent
3fb3be1f1e
commit
ce5df3b0b9
92 changed files with 1410 additions and 1019 deletions
|
@ -9,10 +9,13 @@ import { User, emailVerificationCodes, users } from "@server/db/schema";
|
|||
import { eq } from "drizzle-orm";
|
||||
import { isWithinExpirationDate } from "oslo";
|
||||
import config from "@server/config";
|
||||
import logger from "@server/logger";
|
||||
|
||||
export const verifyEmailBody = z.object({
|
||||
code: z.string(),
|
||||
});
|
||||
export const verifyEmailBody = z
|
||||
.object({
|
||||
code: z.string()
|
||||
})
|
||||
.strict();
|
||||
|
||||
export type VerifyEmailBody = z.infer<typeof verifyEmailBody>;
|
||||
|
||||
|
@ -66,7 +69,7 @@ export async function verifyEmail(
|
|||
await db
|
||||
.update(users)
|
||||
.set({
|
||||
emailVerified: true,
|
||||
emailVerified: true
|
||||
})
|
||||
.where(eq(users.userId, user.userId));
|
||||
} else {
|
||||
|
@ -84,10 +87,11 @@ export async function verifyEmail(
|
|||
message: "Email verified",
|
||||
status: HttpCode.OK,
|
||||
data: {
|
||||
valid,
|
||||
},
|
||||
valid
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
logger.error(error);
|
||||
return next(
|
||||
createHttpError(
|
||||
HttpCode.INTERNAL_SERVER_ERROR,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue