diff --git a/server/routers/auth/2fa.ts b/server/auth/2fa.ts similarity index 100% rename from server/routers/auth/2fa.ts rename to server/auth/2fa.ts diff --git a/server/routers/auth/password.ts b/server/auth/password.ts similarity index 100% rename from server/routers/auth/password.ts rename to server/auth/password.ts diff --git a/server/routers/auth/passwordSchema.ts b/server/auth/passwordSchema.ts similarity index 100% rename from server/routers/auth/passwordSchema.ts rename to server/auth/passwordSchema.ts diff --git a/server/routers/auth/changePassword.ts b/server/routers/auth/changePassword.ts index ae95a0d0..8094973e 100644 --- a/server/routers/auth/changePassword.ts +++ b/server/routers/auth/changePassword.ts @@ -8,9 +8,9 @@ import { db } from "@server/db"; import { User, users } from "@server/db/schema"; import { eq } from "drizzle-orm"; import { response } from "@server/utils"; -import { hashPassword, verifyPassword } from "./password"; -import { verifyTotpCode } from "./2fa"; -import { passwordSchema } from "./passwordSchema"; +import { hashPassword, verifyPassword } from "@server/auth/password"; +import { verifyTotpCode } from "@server/auth/2fa"; +import { passwordSchema } from "@server/auth/passwordSchema"; export const changePasswordBody = z.object({ oldPassword: z.string(), diff --git a/server/routers/auth/disable2fa.ts b/server/routers/auth/disable2fa.ts index 55ae5e80..f0532812 100644 --- a/server/routers/auth/disable2fa.ts +++ b/server/routers/auth/disable2fa.ts @@ -8,8 +8,8 @@ import { db } from "@server/db"; import { twoFactorBackupCodes, User, users } from "@server/db/schema"; import { eq } from "drizzle-orm"; import { response } from "@server/utils"; -import { verifyPassword } from "./password"; -import { verifyTotpCode } from "./2fa"; +import { verifyPassword } from "@server/auth/password"; +import { verifyTotpCode } from "@server/auth/2fa"; export const disable2faBody = z.object({ password: z.string(), diff --git a/server/routers/auth/login.ts b/server/routers/auth/login.ts index 65215f7e..60f70b55 100644 --- a/server/routers/auth/login.ts +++ b/server/routers/auth/login.ts @@ -9,7 +9,7 @@ import { NextFunction, Request, Response } from "express"; import createHttpError from "http-errors"; import { z } from "zod"; import { fromError } from "zod-validation-error"; -import { verifyTotpCode } from "./2fa"; +import { verifyTotpCode } from "@server/auth/2fa"; export const loginBodySchema = z.object({ email: z.string().email(), diff --git a/server/routers/auth/resetPassword.ts b/server/routers/auth/resetPassword.ts index 397a54fa..b13a16e5 100644 --- a/server/routers/auth/resetPassword.ts +++ b/server/routers/auth/resetPassword.ts @@ -8,9 +8,9 @@ import { db } from "@server/db"; import { passwordResetTokens, users } from "@server/db/schema"; import { eq } from "drizzle-orm"; import { sha256 } from "oslo/crypto"; -import { hashPassword } from "./password"; -import { verifyTotpCode } from "./2fa"; -import { passwordSchema } from "./passwordSchema"; +import { hashPassword } from "@server/auth/password"; +import { verifyTotpCode } from "@server/auth/2fa"; +import { passwordSchema } from "@server/auth/passwordSchema"; import { encodeHex } from "oslo/encoding"; import { isWithinExpirationDate } from "oslo"; import lucia from "@server/auth"; diff --git a/server/routers/auth/signup.ts b/server/routers/auth/signup.ts index 5ca53d78..dfd5abfa 100644 --- a/server/routers/auth/signup.ts +++ b/server/routers/auth/signup.ts @@ -11,7 +11,7 @@ import createHttpError from "http-errors"; import response from "@server/utils/response"; import { SqliteError } from "better-sqlite3"; import { sendEmailVerificationCode } from "./sendEmailVerificationCode"; -import { passwordSchema } from "./passwordSchema"; +import { passwordSchema } from "@server/auth/passwordSchema"; export const signupBodySchema = z.object({ email: z.string().email(), diff --git a/server/routers/auth/verifyTotp.ts b/server/routers/auth/verifyTotp.ts index 4434801d..805c97a9 100644 --- a/server/routers/auth/verifyTotp.ts +++ b/server/routers/auth/verifyTotp.ts @@ -8,8 +8,8 @@ import { db } from "@server/db"; import { twoFactorBackupCodes, User, users } from "@server/db/schema"; import { eq } from "drizzle-orm"; import { alphabet, generateRandomString } from "oslo/crypto"; -import { hashPassword } from "./password"; -import { verifyTotpCode } from "./2fa"; +import { hashPassword } from "@server/auth/password"; +import { verifyTotpCode } from "@server/auth/2fa"; export const verifyTotpBody = z.object({ code: z.string(),