Compare commits
49 Commits
develop
...
f9b8c8712a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9b8c8712a | ||
|
|
c6c041819b | ||
|
|
f1767425a0 | ||
|
|
cb0157a73b | ||
|
|
7564dc21e5 | ||
|
|
06760482aa | ||
|
|
1c48d65b7b | ||
|
|
15f299d842 | ||
|
|
49738b87bd | ||
|
|
1b52e2ecbd | ||
|
|
de7bb587e2 | ||
|
|
de3c84957d | ||
|
|
ff289ac2c8 | ||
|
|
19586bd744 | ||
|
|
fc47ad11ad | ||
|
|
ad649de088 | ||
|
|
c6d656b648 | ||
|
|
ac2402d764 | ||
|
|
df8c176dbb | ||
|
|
846de3009c | ||
|
|
194ab35ba6 | ||
|
|
f894756a5f | ||
|
|
82ec7f8b20 | ||
|
|
6222c3b7d1 | ||
|
|
184dbbe21b | ||
|
|
2e28122d97 | ||
|
|
297664b621 | ||
|
|
c51f716cc4 | ||
|
|
2b8e84799d | ||
|
|
cb655263af | ||
|
|
1de8b5c39f | ||
|
|
4074ace97d | ||
|
|
28ee8f8556 | ||
|
|
bbeb2a630a | ||
|
|
bc7f738e55 | ||
|
|
32250636e9 | ||
|
|
6858b24344 | ||
|
|
c04668fda2 | ||
|
|
1cab83f69f | ||
|
|
784cadc6f2 | ||
|
|
39ce46c4dc | ||
|
|
03ec9d863e | ||
|
|
7bfa5a288c | ||
|
|
56f29943b6 | ||
|
|
31561200c2 | ||
|
|
5fa4aa5c37 | ||
|
|
f2038728fd | ||
|
|
450e43aecb | ||
|
|
1d72e28600 |
@@ -912,6 +912,7 @@ public class BOGnrlbbscttService {
|
|||||||
throw new WnbtRestException(wre.getMessage());
|
throw new WnbtRestException(wre.getMessage());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
|
throw new WnbtRestException("게시글 등록 중 오류가 발생했습니다.", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return message;
|
return message;
|
||||||
@@ -1129,6 +1130,7 @@ public class BOGnrlbbscttService {
|
|||||||
throw new WnbtRestException(wre.getMessage());
|
throw new WnbtRestException(wre.getMessage());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
|
throw new WnbtRestException("게시글 수정 중 오류가 발생했습니다.", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return message;
|
return message;
|
||||||
|
|||||||
@@ -197,11 +197,12 @@ public class MngrLoginController {
|
|||||||
log.debug("리프레쉬 토큰이 없는 경우 realm :: {}", realm);
|
log.debug("리프레쉬 토큰이 없는 경우 realm :: {}", realm);
|
||||||
|
|
||||||
//엑세스토큰 삭제
|
//엑세스토큰 삭제
|
||||||
CookieUtils.deleteCookie("ACT","/"+realm, request, response);
|
CookieUtils.deleteCookie("ACT","/", request, response);
|
||||||
CookieUtils.deleteCookie("token_expire","/"+realm, request, response);
|
CookieUtils.deleteCookie("RFT","/" + realm + "/tokens/refresh", request, response);
|
||||||
|
CookieUtils.deleteCookie("token_expire","/", request, response);
|
||||||
|
|
||||||
response.sendRedirect("/"+realm);
|
response.sendRedirect("/"+realm);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//리프레쉬 토큰 있을 경우(존재한다는 자체가 refresh토큰이 만료된 상태가 아님)
|
//리프레쉬 토큰 있을 경우(존재한다는 자체가 refresh토큰이 만료된 상태가 아님)
|
||||||
|
|||||||
@@ -371,7 +371,9 @@ public class MngrLoggingInterceptor implements HandlerInterceptor {
|
|||||||
String cookieValue = agentId + ":" + md5(agentId + ":" + md5(System.currentTimeMillis() + ":" + random.nextInt())).substring(5, 10);
|
String cookieValue = agentId + ":" + md5(agentId + ":" + md5(System.currentTimeMillis() + ":" + random.nextInt())).substring(5, 10);
|
||||||
Cookie agentIdCookie = new Cookie("agent_id", cookieValue);
|
Cookie agentIdCookie = new Cookie("agent_id", cookieValue);
|
||||||
agentIdCookie.setMaxAge(86400 * 365 * 10); // 10년
|
agentIdCookie.setMaxAge(86400 * 365 * 10); // 10년
|
||||||
agentIdCookie.setDomain(domain);
|
if (!request.getServerName().startsWith("loc.")) {
|
||||||
|
agentIdCookie.setDomain(domain);
|
||||||
|
}
|
||||||
// agentIdCookie.setHttpOnly(true);
|
// agentIdCookie.setHttpOnly(true);
|
||||||
agentIdCookie.setPath("/mngr");
|
agentIdCookie.setPath("/mngr");
|
||||||
// agentIdCookie.setSecure(true);
|
// agentIdCookie.setSecure(true);
|
||||||
|
|||||||
@@ -51,14 +51,17 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter {
|
|||||||
String accessToken = extractToken(request);
|
String accessToken = extractToken(request);
|
||||||
|
|
||||||
|
|
||||||
String sysDvCd = RealmContextHolder.getSysDvCdRealm();
|
|
||||||
String expireChk = request.getParameter("expire");
|
String expireChk = request.getParameter("expire");
|
||||||
String tokenExpireCookie = CookieUtils.getCookieValue("token_expire", request);
|
String tokenExpireCookie = CookieUtils.getCookieValue("token_expire", request);
|
||||||
|
|
||||||
//사용자이면서 ACT가 없는데 tokenExpire는 있을 경우
|
//사용자이면서 ACT가 없는데 tokenExpire는 있을 경우
|
||||||
//로그인된 사용자지만 엑세스 토큰이 만료되어 다시 재발급 받아야 하는 대상
|
//로그인된 사용자지만 엑세스 토큰이 만료되어 다시 재발급 받아야 하는 대상
|
||||||
//expire값은 루프 요청 방지
|
//인증 진입점은 만료 쿠키가 남아 있어도 갱신 대상으로 보내지 않는다.
|
||||||
if("01".equals(sysDvCd) && !StringUtils.hasText(accessToken) && StringUtils.hasText(tokenExpireCookie) && !"p".equals(expireChk)){
|
//쿠키 삭제가 지연되거나 이전 경로의 쿠키가 남아도 로그인 화면까지는 항상 도달해야 한다.
|
||||||
|
if(!isAuthenticationEndpoint(requestUri, realm)
|
||||||
|
&& !StringUtils.hasText(accessToken)
|
||||||
|
&& StringUtils.hasText(tokenExpireCookie)
|
||||||
|
&& !"p".equals(expireChk)){
|
||||||
response.sendRedirect("/"+realm+"/tokens/refresh?redirect_uri=%s&expire=%s".formatted(URLEncoder.encode(UrlExtractor.getOriginalURL(request), StandardCharset.UTF_8), "p"));
|
response.sendRedirect("/"+realm+"/tokens/refresh?redirect_uri=%s&expire=%s".formatted(URLEncoder.encode(UrlExtractor.getOriginalURL(request), StandardCharset.UTF_8), "p"));
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -66,7 +69,7 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter {
|
|||||||
|
|
||||||
|
|
||||||
// accessToken이 있고 refresh Token 요청이 아닌경우
|
// accessToken이 있고 refresh Token 요청이 아닌경우
|
||||||
if (StringUtils.hasText(accessToken) && !requestUri.contains("/tokens/refresh")) {
|
if (StringUtils.hasText(accessToken) && !isAuthenticationEndpoint(requestUri, realm)) {
|
||||||
UserDetails userDetails = customUserDetailService.loadUserByUsername(accessToken);
|
UserDetails userDetails = customUserDetailService.loadUserByUsername(accessToken);
|
||||||
if (userDetails != null) {
|
if (userDetails != null) {
|
||||||
log.debug("user details: {}", userDetails);
|
log.debug("user details: {}", userDetails);
|
||||||
@@ -92,6 +95,15 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isAuthenticationEndpoint(String requestUri, String realm) {
|
||||||
|
String realmPath = "/" + realm;
|
||||||
|
|
||||||
|
return requestUri.equals(realmPath)
|
||||||
|
|| requestUri.startsWith(realmPath + "/login")
|
||||||
|
|| requestUri.equals(realmPath + "/logout")
|
||||||
|
|| requestUri.startsWith(realmPath + "/tokens/refresh");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private String extractToken(HttpServletRequest request) {
|
private String extractToken(HttpServletRequest request) {
|
||||||
|
|||||||
@@ -44,9 +44,12 @@ public abstract class CookieUtils {
|
|||||||
Cookie cookie = new Cookie(name, null);
|
Cookie cookie = new Cookie(name, null);
|
||||||
cookie.setMaxAge(0);
|
cookie.setMaxAge(0);
|
||||||
cookie.setPath(path);
|
cookie.setPath(path);
|
||||||
cookie.setDomain(originHost);
|
setCookieDomain(cookie, request, originHost);
|
||||||
cookie.setHttpOnly(true);
|
cookie.setHttpOnly(true);
|
||||||
response.addCookie(cookie);
|
response.addCookie(cookie);
|
||||||
|
|
||||||
|
// loc 환경에서는 이전에 상위 도메인으로 저장된 쿠키도 함께 삭제한다.
|
||||||
|
deleteLegacyDomainCookie(name, path, request, response, originHost);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void createCookie(String name, String value, String path, int maxAge, boolean httpOnly, HttpServletRequest request, HttpServletResponse response) {
|
public static void createCookie(String name, String value, String path, int maxAge, boolean httpOnly, HttpServletRequest request, HttpServletResponse response) {
|
||||||
@@ -58,10 +61,12 @@ public abstract class CookieUtils {
|
|||||||
|
|
||||||
String originHost = UrlExtractor.getOriginalHost(host);
|
String originHost = UrlExtractor.getOriginalHost(host);
|
||||||
|
|
||||||
|
deleteLegacyDomainCookie(name, path, request, response, originHost);
|
||||||
|
|
||||||
Cookie cookie = new Cookie(name, value);
|
Cookie cookie = new Cookie(name, value);
|
||||||
cookie.setMaxAge(maxAge);
|
cookie.setMaxAge(maxAge);
|
||||||
cookie.setPath(path);
|
cookie.setPath(path);
|
||||||
cookie.setDomain(originHost);
|
setCookieDomain(cookie, request, originHost);
|
||||||
cookie.setHttpOnly(httpOnly);
|
cookie.setHttpOnly(httpOnly);
|
||||||
response.addCookie(cookie);
|
response.addCookie(cookie);
|
||||||
}
|
}
|
||||||
@@ -77,7 +82,7 @@ public abstract class CookieUtils {
|
|||||||
|
|
||||||
Cookie cookie = new Cookie(name, value);
|
Cookie cookie = new Cookie(name, value);
|
||||||
cookie.setPath(path);
|
cookie.setPath(path);
|
||||||
cookie.setDomain(originHost);
|
setCookieDomain(cookie, request, originHost);
|
||||||
cookie.setHttpOnly(httpOnly);
|
cookie.setHttpOnly(httpOnly);
|
||||||
response.addCookie(cookie);
|
response.addCookie(cookie);
|
||||||
}
|
}
|
||||||
@@ -96,4 +101,30 @@ public abstract class CookieUtils {
|
|||||||
return Map.of("ACTPath", ACTPath, "RFTPath", RFTPath);
|
return Map.of("ACTPath", ACTPath, "RFTPath", RFTPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void setCookieDomain(Cookie cookie, HttpServletRequest request, String domain) {
|
||||||
|
if (!request.getServerName().startsWith("loc.")) {
|
||||||
|
cookie.setDomain(domain);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void deleteLegacyDomainCookie(String name, String path, HttpServletRequest request, HttpServletResponse response, String domain) {
|
||||||
|
if (request.getServerName().startsWith("loc.")) {
|
||||||
|
addDomainDeleteCookie(name, path, domain, response);
|
||||||
|
|
||||||
|
int firstDot = domain.indexOf('.');
|
||||||
|
if (firstDot > 0) {
|
||||||
|
addDomainDeleteCookie(name, path, domain.substring(firstDot + 1), response);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void addDomainDeleteCookie(String name, String path, String domain, HttpServletResponse response) {
|
||||||
|
Cookie domainCookie = new Cookie(name, null);
|
||||||
|
domainCookie.setMaxAge(0);
|
||||||
|
domainCookie.setPath(path);
|
||||||
|
domainCookie.setDomain(domain);
|
||||||
|
domainCookie.setHttpOnly(true);
|
||||||
|
response.addCookie(domainCookie);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2659,7 +2659,7 @@
|
|||||||
AND FGI.IMG_KND = '02'
|
AND FGI.IMG_KND = '02'
|
||||||
AND FGI.CUT_NB = 1
|
AND FGI.CUT_NB = 1
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
) AS GOODS_IMG_COURS
|
) AS IMG
|
||||||
,FG.GOODS_NM
|
,FG.GOODS_NM
|
||||||
,FG.GOODS_ICON_CD AS ICON_CD_NM_LIST
|
,FG.GOODS_ICON_CD AS ICON_CD_NM_LIST
|
||||||
,FG.SRT_DC AS REPRSNT_DC
|
,FG.SRT_DC AS REPRSNT_DC
|
||||||
|
|||||||
@@ -486,7 +486,7 @@
|
|||||||
</c:when>
|
</c:when>
|
||||||
<c:otherwise>
|
<c:otherwise>
|
||||||
<button type="button" class="btn xsm primary ml-5"
|
<button type="button" class="btn xsm primary ml-5"
|
||||||
onclick="fn_open_modal('#modalDiv','#product-search','/mngr/goods/goodsmngr/selectGoodsSrchPopupForm',{'goodsKndCd':'01'}); return false;">
|
onclick="selected = []; fn_open_modal('#modalDiv','#product-search','/mngr/goods/goodsmngr/selectGoodsSrchPopupForm',{'goodsKndCd':'01'}); return false;">
|
||||||
검색
|
검색
|
||||||
</button>
|
</button>
|
||||||
</c:otherwise>
|
</c:otherwise>
|
||||||
|
|||||||
@@ -824,7 +824,9 @@
|
|||||||
<i class="icon icon_lock"></i>
|
<i class="icon icon_lock"></i>
|
||||||
</c:if>
|
</c:if>
|
||||||
</h4>
|
</h4>
|
||||||
<p class="eventDetail__date"><c:out value="${bbscttInfo.sumRegistDt}"/></p>
|
<c:if test="${bbsInfo.registDtYn eq 'Y'}">
|
||||||
|
<p class="eventDetail__date"><c:out value="${bbscttInfo.sumRegistDt}"/></p>
|
||||||
|
</c:if>
|
||||||
</div>
|
</div>
|
||||||
<%-------------------------------%>
|
<%-------------------------------%>
|
||||||
<%--첨부 파일 다운로드 영역--%>
|
<%--첨부 파일 다운로드 영역--%>
|
||||||
@@ -961,7 +963,7 @@
|
|||||||
</c:if>
|
</c:if>
|
||||||
<a class="product-detail" href="javascript:void(0);" onclick="fn_move_goods_dtl('<c:out value="${item.goodsInnb}"/>');">
|
<a class="product-detail" href="javascript:void(0);" onclick="fn_move_goods_dtl('<c:out value="${item.goodsInnb}"/>');">
|
||||||
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
|
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
|
||||||
<img src="<c:out value = "${cdnurl}${item.goodsImgCours}"/>"
|
<img src="<c:out value = "${cdnurl}${item.img}"/>"
|
||||||
onerror="this.src='/pc/images/image_placeholder.png'" alt="<c:out value="${item.goodsNm}"/>">
|
onerror="this.src='/pc/images/image_placeholder.png'" alt="<c:out value="${item.goodsNm}"/>">
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1254,7 +1254,9 @@
|
|||||||
</c:if>
|
</c:if>
|
||||||
</h4>
|
</h4>
|
||||||
<ul class="eventDetail__list">
|
<ul class="eventDetail__list">
|
||||||
<li><c:out value="${bbscttInfo.sumRegistDt}"/></li>
|
<c:if test="${bbsInfo.registDtYn eq 'Y'}">
|
||||||
|
<li><c:out value="${bbscttInfo.sumRegistDt}"/></li>
|
||||||
|
</c:if>
|
||||||
<li>조회 <c:out value="${bbscttInfo.inqireCnt}"/></li>
|
<li>조회 <c:out value="${bbscttInfo.inqireCnt}"/></li>
|
||||||
<li>
|
<li>
|
||||||
<c:choose>
|
<c:choose>
|
||||||
@@ -1439,7 +1441,7 @@
|
|||||||
<a style="cursor:pointer" loading="lazy"
|
<a style="cursor:pointer" loading="lazy"
|
||||||
onclick = "fn_move_goods_dtl(<c:out value="${item.goodsInnb}"/>)">
|
onclick = "fn_move_goods_dtl(<c:out value="${item.goodsInnb}"/>)">
|
||||||
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
|
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
|
||||||
<img src="<c:out value = "${cdnurl}${item.goodsImgCours}"/>"
|
<img src="<c:out value = "${cdnurl}${item.img}"/>"
|
||||||
onerror="this.src='/pc/images/image_placeholder.png'"
|
onerror="this.src='/pc/images/image_placeholder.png'"
|
||||||
alt="<c:out value="${item.goodsNm}"/>">
|
alt="<c:out value="${item.goodsNm}"/>">
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -1059,7 +1059,7 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<%--게시판 등록 사용여부--%>
|
<%--게시판 등록 사용여부--%>
|
||||||
<c:if test = "${bbsInfo.bbscttRegist eq 'Y' && (bbsInfo.bbsTyCd eq '01' || bbsInfo.bbsTyCd eq '08') && bbsInfo.sknTyCd ne '02'}"><%--갤러리타입 등록 x--%>
|
<c:if test = "${bbsInfo.bbscttRegist eq 'Y' && resultMap.registAuthResult eq 'Y' && (bbsInfo.bbsTyCd eq '01' || bbsInfo.bbsTyCd eq '08') && bbsInfo.sknTyCd ne '02'}"><%--갤러리타입 등록 x--%>
|
||||||
<div class="infoSection">
|
<div class="infoSection">
|
||||||
<a style="cursor:pointer" class="btn md full theme" id = "regBtn"><spring:message code="button.insert"/>하기</a>
|
<a style="cursor:pointer" class="btn md full theme" id = "regBtn"><spring:message code="button.insert"/>하기</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user