From 154ef07f9a3d5d971979b1e916a8c53e7e6e3f57 Mon Sep 17 00:00:00 2001 From: bjkim Date: Tue, 2 Sep 2025 14:33:19 +0900 Subject: [PATCH] =?UTF-8?q?[MOD]=20refreshtoken=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../etri/autoflow/entity/WorkflowEntity.java | 3 ++- .../etri/autoflow/security/jwt/JwtUtils.java | 19 +++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/main/java/kr/re/etri/autoflow/entity/WorkflowEntity.java b/src/main/java/kr/re/etri/autoflow/entity/WorkflowEntity.java index 0c6a465..2a798cf 100644 --- a/src/main/java/kr/re/etri/autoflow/entity/WorkflowEntity.java +++ b/src/main/java/kr/re/etri/autoflow/entity/WorkflowEntity.java @@ -18,7 +18,7 @@ public class WorkflowEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) - @Schema(description = "워크플로우 ID22", example = "null", defaultValue = "null") + @Schema(description = "워크플로우 ID", example = "null", defaultValue = "null") @Comment("ID") private Long id; @@ -55,5 +55,6 @@ public class WorkflowEntity { private String kubeflowStatus; @Schema(description = "프로젝트 아이디", example = "1", defaultValue = "0") + @Column(nullable = false) private Long projectId; } diff --git a/src/main/java/kr/re/etri/autoflow/security/jwt/JwtUtils.java b/src/main/java/kr/re/etri/autoflow/security/jwt/JwtUtils.java index 0b86c50..c509c8e 100644 --- a/src/main/java/kr/re/etri/autoflow/security/jwt/JwtUtils.java +++ b/src/main/java/kr/re/etri/autoflow/security/jwt/JwtUtils.java @@ -108,10 +108,21 @@ public class JwtUtils { .build(); } - private String getCookieValueByName(HttpServletRequest request, String name) { - Cookie cookie = WebUtils.getCookie(request, name); - return cookie != null ? cookie.getValue() : null; - } + private String getCookieValueByName(HttpServletRequest request, String name) { + // 1. 쿠키에서 먼저 찾기 + Cookie cookie = WebUtils.getCookie(request, name); + if (cookie != null) { + return cookie.getValue(); + } + + // 2. 없으면 헤더에서 찾기 + String headerValue = request.getHeader(name); + if (headerValue != null && !headerValue.isBlank()) { + return headerValue; + } + + return null; + } // private String getCookieValueByName(HttpServletRequest request, String name) { // Cookie cookie = WebUtils.getCookie(request, name);