

250328 김혜민 자동로그인 수정
@5dbcda4b2240191646bc155b07d2124fb22fd680
--- src/main/java/com/takensoft/cms/token/service/impl/RefreshTokenServiceImpl.java
+++ src/main/java/com/takensoft/cms/token/service/impl/RefreshTokenServiceImpl.java
... | ... | @@ -185,7 +185,7 @@ |
185 | 185 |
} |
186 | 186 |
} |
187 | 187 |
|
188 |
- Date expired = (Date) jwtUtil.getClaim(refreshToken, "Expired"); |
|
188 |
+ Date expired = (Date) jwtUtil.getClaim(refreshToken, "expired"); |
|
189 | 189 |
|
190 | 190 |
// 만료시간과 현재 시간의 차이 계산 |
191 | 191 |
long timeDffrnc = (expired.getTime() - new Date().getTime()) / (1000 * 60 * 60); |
... | ... | @@ -270,12 +270,12 @@ |
270 | 270 |
@Override |
271 | 271 |
public int deleteAll() { |
272 | 272 |
// JWT 방식이면서 중복 로그인 비허용인 경우 redis도 정리 |
273 |
- /*if (!loginPolicyService.getPolicy()) { |
|
273 |
+ if (!loginPolicyService.getPolicy()) { |
|
274 | 274 |
Set<String> keys = redisTemplate.keys("jwt:*"); |
275 | 275 |
if (keys != null && !keys.isEmpty()) { |
276 | 276 |
redisTemplate.delete(keys); |
277 | 277 |
} |
278 |
- }*/ |
|
278 |
+ } |
|
279 | 279 |
return refreshTokenDAO.deleteAll(); // DB에서 리프레시 토큰 전부 삭제 |
280 | 280 |
} |
281 | 281 |
|
--- src/main/java/com/takensoft/common/config/SecurityConfig.java
+++ src/main/java/com/takensoft/common/config/SecurityConfig.java
... | ... | @@ -170,12 +170,12 @@ |
170 | 170 |
); |
171 | 171 |
|
172 | 172 |
// 로그인 방식에 따라 필터 적용 (JWT or 세션) |
173 |
- /* if ("S".equals(loginModeService.getLoginMode())) { |
|
173 |
+ if (loginModeService.getLoginMode().equals("S")) { |
|
174 | 174 |
http.addFilterBefore(new SessionAuthFilter(jwtUtil, redisTemplate, loginPolicyService), LoginFilter.class); |
175 | 175 |
} else { |
176 |
+ http.addFilterBefore(new JWTFilter(jwtUtil, appConfig, loginPolicyService, redisTemplate), LoginFilter.class); |
|
177 |
+ } |
|
176 | 178 |
|
177 |
- }*/ |
|
178 |
- http.addFilterBefore(new JWTFilter(jwtUtil, appConfig, loginPolicyService, redisTemplate), LoginFilter.class); |
|
179 | 179 |
http.addFilterBefore(new AccesFilter(accesCtrlService, httpRequestUtil, appConfig), JWTFilter.class); // 아이피 검증 |
180 | 180 |
http.addFilterAt(new LoginFilter(authenticationManager(authenticationConfiguration), jwtUtil, refreshTokenService, lgnHstryService, httpRequestUtil, |
181 | 181 |
loginModeService, loginPolicyService, sessionUtil, JWT_ACCESSTIME, JWT_REFRESHTIME, COOKIE_TIME, redisTemplate), UsernamePasswordAuthenticationFilter.class); // 로그인 필터 |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?