diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-10-17 09:43:56 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-10-17 09:43:56 +0000 |
| commit | ab8b726fee9a82ba98c550a151988c86dc096efd (patch) | |
| tree | f0293e2f7fcababb9e0fecda2eb025e5fce01102 /app/api | |
| parent | bea9853efe30c393b0d030bc552c1f5bbb838835 (diff) | |
(대표님) 데이터룸 관련 개발사항
Diffstat (limited to 'app/api')
| -rw-r--r-- | app/api/auth/[...nextauth]/route.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/api/auth/[...nextauth]/route.ts b/app/api/auth/[...nextauth]/route.ts index 3b0f8c61..d6ec807f 100644 --- a/app/api/auth/[...nextauth]/route.ts +++ b/app/api/auth/[...nextauth]/route.ts @@ -30,6 +30,7 @@ declare module "next-auth" { image?: string | null companyId?: number | null techCompanyId?: number | null + ownerCompanyId?: number | null domain?: string | null reAuthTime?: number | null authMethod?: AuthMethod @@ -44,6 +45,7 @@ declare module "next-auth" { imageUrl?: string | null companyId?: number | null techCompanyId?: number | null + ownerCompanyId?: number | null domain?: string | null reAuthTime?: number | null authMethod?: AuthMethod @@ -58,6 +60,7 @@ declare module "next-auth/jwt" { imageUrl?: string | null companyId?: number | null techCompanyId?: number | null + ownerCompanyId?: number | null domain?: string | null reAuthTime?: number | null authMethod?: AuthMethod @@ -315,6 +318,7 @@ export const authOptions: NextAuthOptions = { token.sessionExpiredAt = reAuthTime + sessionTimeoutMs token.dbSessionId = user.dbSessionId token.roles = user.roles + token.ownerCompanyId = user.ownerCompanyId } // ✅ 기존 토큰이 있고 로그인이 아닌 경우, DB에서 최신 사용자 정보 조회 @@ -333,6 +337,7 @@ export const authOptions: NextAuthOptions = { token.name = latestUser.name token.companyId = latestUser.companyId token.techCompanyId = latestUser.techCompanyId + token.ownerCompanyId = latestUser.ownerCompanyId // roles 정보도 최신으로 업데이트 const userRoles = await getUserRoles(parseInt(token.id)) @@ -358,6 +363,7 @@ export const authOptions: NextAuthOptions = { token.name = latestUser.name token.companyId = latestUser.companyId token.techCompanyId = latestUser.techCompanyId + token.ownerCompanyId = latestUser.ownerCompanyId token.roles = await getUserRoles(numericUserId) } @@ -430,6 +436,7 @@ export const authOptions: NextAuthOptions = { domain: token.domain as string, companyId: token.companyId as number, techCompanyId: token.techCompanyId as number, + ownerCompanyId: token.ownerCompanyId as number, image: token.imageUrl ?? null, reAuthTime: token.reAuthTime as number | null, authMethod: token.authMethod as AuthMethod, |
