@@ -3,21 +3,18 @@ import axios from 'axios';
33
44const API_BASE_URL = 'https://gdgocinha.site/auth' ; // 프록시 대상 주소
55
6- export async function POST ( req , { params } ) {
7- const action = params . action ; // 'refresh' or 'logout'
8- const targetUrl = `${ API_BASE_URL . replace ( / \/ $ / , '' ) } /${ action . replace ( / ^ \/ / , '' ) } ` ;
6+ export async function POST ( req ) {
7+ const targetUrl = `${ API_BASE_URL } /refresh` ;
98
109 try {
1110 const cookies = req . headers . get ( 'cookie' ) || '' ;
12- const accessToken = req . headers . get ( 'authorization' ) ;
1311
1412 const response = await axios . post (
1513 targetUrl ,
16- await req . json ( ) ,
14+ { } ,
1715 {
1816 headers : {
1917 'Content-Type' : 'application/json' ,
20- ...( accessToken && { Authorization : accessToken } ) ,
2118 Cookie : cookies ,
2219 } ,
2320 withCredentials : true ,
@@ -44,10 +41,7 @@ export async function POST(req, { params }) {
4441
4542 return nextResponse ;
4643 } catch ( error ) {
47- console . error ( `[AUTH PROXY ERROR] /${ action } ` , error . response ?. data || error . message ) ;
48- return NextResponse . json (
49- { error : 'AUTH PROXY ERROR' } ,
50- { status : error . response ?. status || 500 }
51- ) ;
44+ console . error ( '[AUTH PROXY ERROR] /refresh' , error . response ?. data || error . message ) ;
45+ return NextResponse . json ( { error : 'AUTH PROXY ERROR' } , { status : error . response ?. status || 500 } ) ;
5246 }
5347}
0 commit comments