package com.bytesw.bytebot.controller.sso;

import lombok.extern.log4j.Log4j2;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.security.Principal;

@Controller
@ConditionalOnProperty(
        name="application.services.security",
        havingValue = "oauth2sso",
        matchIfMissing = false)
@Log4j2
public class TokenFailController {

    @RequestMapping(value = {"/token-fail"}, method = RequestMethod.GET)
    public final String goodbye(HttpServletRequest request, HttpServletResponse response, Principal principal) {
        return "/token-fail";
    }
}
