package com.eactive.eai.adapter.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;

@Controller
public class TokenRedirectController {

    @PostMapping("/sample/v1/oauth/token")
    public void redirectPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // 포워딩할 URL을 지정
        String targetUrl = "/api/v1/oauth/token";
        // 요청과 응답을 다른 URL로 포워딩
        request.getRequestDispatcher(targetUrl).forward(request, response);
    }
}
