Fix auth URLs to use relative paths instead of absolute NEXT_PUBLIC_API_URL
Some checks failed
continuous-integration/drone/push Build is failing

- Change login page to use /api/auth/login/ instead of absolute URL
- Change register page to use /api/auth/register/ instead of absolute URL
- This fixes the 404 error with /auth/undefined/api/auth/login/ path
- Now uses Next.js rewrites from next.config.js correctly
This commit is contained in:
2025-11-08 19:40:33 +09:00
parent e82f0f8e6f
commit 2b217ded53
2 changed files with 2 additions and 3 deletions

View File

@@ -23,7 +23,7 @@ export default function LoginPage() {
setApiError(null) setApiError(null)
try { try {
const res = await fetch( const res = await fetch(
`${process.env.NEXT_PUBLIC_API_URL}/api/auth/login/`, `/api/auth/login/`,
{ {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },

View File

@@ -46,8 +46,7 @@ export default function RegisterPage() {
} }
try { try {
const API = process.env.NEXT_PUBLIC_API_URL || 'https://links.shareon.kr' const response = await fetch(`/api/auth/register/`, {
const response = await fetch(`${API}/api/auth/register/`, {
method: 'POST', method: 'POST',
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',