summaryrefslogtreecommitdiff
path: root/lib/users/service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/users/service.ts')
-rw-r--r--lib/users/service.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/users/service.ts b/lib/users/service.ts
index ae97beed..8b2c927e 100644
--- a/lib/users/service.ts
+++ b/lib/users/service.ts
@@ -202,6 +202,32 @@ export async function findEmailandOtp(email: string, code: string) {
}
}
+export async function findEmailTemp(email: string) {
+ try {
+
+ // 2) 사용자 정보 추가로 조회
+ const userRecord: User | null = await getUserByEmail(email)
+ if (!userRecord) {
+ return null
+ }
+
+ // 3) 필요한 형태로 "통합된 객체"를 반환
+ return {
+ email: userRecord.email,
+ name: userRecord.name, // DB 에서 가져온 실제 이름
+ id: userRecord.id, // user id
+ imageUrl:userRecord.imageUrl,
+ companyId:userRecord.companyId,
+ domain:userRecord.domain
+ // 기타 필요한 필드...
+ }
+
+ } catch (error) {
+ // 에러 처리
+ throw new Error('Failed to fetch user & otp')
+ }
+}
+
export async function updateUserProfileImage(formData: FormData) {
// 1) FormData에서 데이터 꺼내기
const file = formData.get("file") as File | null