diff options
Diffstat (limited to 'lib/admin-users')
| -rw-r--r-- | lib/admin-users/service.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/admin-users/service.ts b/lib/admin-users/service.ts index 5d738d38..44111bef 100644 --- a/lib/admin-users/service.ts +++ b/lib/admin-users/service.ts @@ -7,6 +7,7 @@ import logger from '@/lib/logger'; import { Role, roles, users, userView, type User, type UserView } from "@/db/schema/users"; // User 테이블 import { type Company } from "@/db/schema/companies"; // User 테이블 import { asc, desc, ilike, inArray, and, gte, lte, not, or, eq } from "drizzle-orm"; +import { headers } from 'next/headers'; // 레포지토리 함수들 (예시) - 아래처럼 작성했다고 가정 import { @@ -196,7 +197,11 @@ export async function createAdminUser(input: CreateUserSchema & { language?: str ? "[eVCP] 어드민 계정이 생성되었습니다." : "[eVCP] Admin Account Created"; - const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || 'http://3.36.56.124:3000' + + const headersList = await headers(); + const host = headersList.get('host') || 'localhost:3000'; + + const baseUrl = `http://${host}` const loginUrl = userLang === "ko" ? `${baseUrl}/ko/partners` |
