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/verifyOtp.ts | |
| parent | 9ceed79cf32c896f8a998399bf1b296506b2cd4a (diff) | |
~20250428 작업사항
Diffstat (limited to 'lib/users/verifyOtp.ts')
| -rw-r--r-- | lib/users/verifyOtp.ts | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/users/verifyOtp.ts b/lib/users/verifyOtp.ts index aa759338..84919024 100644 --- a/lib/users/verifyOtp.ts +++ b/lib/users/verifyOtp.ts @@ -1,5 +1,5 @@ // lib/users/verifyOtp.ts -import { findEmailandOtp } from '@/lib/users/service' +import { findEmailTemp, findEmailandOtp } from '@/lib/users/service' // "email과 code가 맞으면 유저 정보, 아니면 null" 형태로 작성 export async function verifyOtp(email: string, code: string) { @@ -27,6 +27,27 @@ export async function verifyOtp(email: string, code: string) { } } +export async function verifyOtpTemp(email: string) { + // DB에서 email과 code가 맞는지, 만료 안됐는지 검증 + const otpRecord = await findEmailTemp(email) + if (!otpRecord) { + return null + } + + + // 여기서 otpRecord에 유저 정보가 있다고 가정 + // 예: otpRecord.userId, otpRecord.userName, otpRecord.email 등 + // 실제 DB 설계에 맞춰 필드명을 조정하세요. + return { + email: otpRecord.email, + name: otpRecord.name, + id: otpRecord.id, + imageUrl: otpRecord.imageUrl, + companyId: otpRecord.companyId, + domain: otpRecord.domain, + } +} + export async function verifyExternalCredentials(username: string, password: string) { // DB에서 email과 code가 맞는지, 만료 안됐는지 검증 |
