diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-04-28 02:13:30 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-04-28 02:13:30 +0000 |
| commit | ef4c533ebacc2cdc97e518f30e9a9350004fcdfb (patch) | |
| tree | 345251a3ed0f4429716fa5edaa31024d8f4cb560 /lib/users/repository.ts | |
| parent | 9ceed79cf32c896f8a998399bf1b296506b2cd4a (diff) | |
~20250428 작업사항
Diffstat (limited to 'lib/users/repository.ts')
| -rw-r--r-- | lib/users/repository.ts | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/users/repository.ts b/lib/users/repository.ts index 78d1668b..3a404bde 100644 --- a/lib/users/repository.ts +++ b/lib/users/repository.ts @@ -111,8 +111,6 @@ export const getOtpByEmailAndCode = async ( code: string ): Promise<Otp | null> => { - console.log(email, code, "db") - const [otp] = await db .select() .from(otps) @@ -123,6 +121,20 @@ export const getOtpByEmailAndCode = async ( return otp ?? null; }; +export const getOtpByEmail = async ( + email: string, +): Promise<User | null> => { + + const [user] = await db + .select() + .from(users) + .where( + eq(users.email, email) + ); + + return user ?? null; +}; + export async function findAllRoles(): Promise<Role[]> { return db.select().from(roles).where(eq(roles.domain ,'evcp')).orderBy(asc(roles.name)); }
\ No newline at end of file |
