summaryrefslogtreecommitdiff
path: root/app/api/auth
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-06-15 04:43:44 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-06-15 04:43:44 +0000
commitb63d886613707c99cb4b244c8442860c2a15af69 (patch)
tree4e33596a626f9dba47836a207b456a86eef5b977 /app/api/auth
parenta15475296b9da1cb83995b24acf9a6a20b635756 (diff)
(최겸) 메뉴 및 DB 수정(기술영업 벤더, RFQ, User)
Diffstat (limited to 'app/api/auth')
-rw-r--r--app/api/auth/[...nextauth]/route.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/api/auth/[...nextauth]/route.ts b/app/api/auth/[...nextauth]/route.ts
index 5e4da7ed..4673d8ae 100644
--- a/app/api/auth/[...nextauth]/route.ts
+++ b/app/api/auth/[...nextauth]/route.ts
@@ -25,6 +25,7 @@ declare module "next-auth" {
email?: string | null
image?: string | null
companyId?: number | null
+ techCompanyId?: number | null
domain?: string | null
}
@@ -37,6 +38,7 @@ declare module "next-auth" {
id: string
imageUrl?: string | null
companyId?: number | null
+ techCompanyId?: number | null
domain?: string | null
// 필요한 필드를 추가로 선언 가능
}
@@ -66,6 +68,7 @@ export const authOptions: NextAuthOptions = {
imageUrl: user.imageUrl ?? null,
name: user.name, // DB에서 가져온 실제 이름
companyId: user.companyId, // DB에서 가져온 실제 이름
+ techCompanyId: (user as any).techCompanyId, // techVendor ID
domain: user.domain, // DB에서 가져온 실제 이름
}
},
@@ -123,6 +126,7 @@ export const authOptions: NextAuthOptions = {
// 첫 번째 provider와 동일한 필드 구조 유지
imageUrl: user.imageUrl ?? null,
companyId: user.companyId,
+ techCompanyId: user.techCompanyId,
domain: user.domain
};
}
@@ -149,6 +153,7 @@ export const authOptions: NextAuthOptions = {
token.email = user.email
token.name = user.name
token.companyId = user.companyId
+ token.techCompanyId = user.techCompanyId
token.domain = user.domain
; (token as any).imageUrl = (user as any).imageUrl
}
@@ -162,6 +167,7 @@ export const authOptions: NextAuthOptions = {
name: token.name as string,
domain: token.domain as string,
companyId: token.companyId as number,
+ techCompanyId: token.techCompanyId as number,
image: (token as any).imageUrl ?? null
}
}