Fix localhost hardcoding in auth - use Vercel env vars

This commit is contained in:
wass08
2026-02-11 18:21:34 +09:00
parent 9bc65f38c1
commit e0c9d40bcf
2 changed files with 28 additions and 5 deletions
@@ -1,6 +1,5 @@
import { headers as nextHeaders } from 'next/headers'
const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3000'
import { BASE_URL } from '@/lib/utils'
/**
* Get the current session from Better Auth backend (server-side)
@@ -10,7 +9,7 @@ export async function getSession() {
const headersList = await nextHeaders()
// Make authenticated request to the auth backend to get session
const response = await fetch(`${API_URL}/api/auth/get-session`, {
const response = await fetch(`${BASE_URL}/api/auth/get-session`, {
headers: {
cookie: headersList.get('cookie') || '',
},