From 539f8d827693a0cb5ed714a6e508acd82e113fe8 Mon Sep 17 00:00:00 2001 From: CHAE Date: Mon, 4 Dec 2023 18:25:46 +0900 Subject: [PATCH] =?UTF-8?q?:ambulance:=20Fix:=20JWT=20=ED=86=A0=ED=81=B0?= =?UTF-8?q?=20=EC=9D=B8=EC=A6=9D=20=ED=99=9C=EC=84=B1=ED=99=94=20=EB=B0=8F?= =?UTF-8?q?=20=EC=9C=A0=ED=9A=A8=EC=8B=9C=EA=B0=84=2012=EC=8B=9C=EA=B0=84?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=ED=99=95=EB=8C=80=20(#131)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/diareat/diareat/auth/component/JwtTokenProvider.java | 2 +- src/main/java/com/diareat/diareat/config/WebSecurityConfig.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/diareat/diareat/auth/component/JwtTokenProvider.java b/src/main/java/com/diareat/diareat/auth/component/JwtTokenProvider.java index cbaa13d..7a56add 100644 --- a/src/main/java/com/diareat/diareat/auth/component/JwtTokenProvider.java +++ b/src/main/java/com/diareat/diareat/auth/component/JwtTokenProvider.java @@ -39,7 +39,7 @@ public String createToken(String userPk) { return Jwts.builder() .setClaims(claims) // 정보 저장 .setIssuedAt(now) // 토큰 발행 시간 정보 - .setExpiration(new Date(now.getTime() + (360 * 60 * 1000L))) // 토큰 유효시각 설정 (360분) + .setExpiration(new Date(now.getTime() + (720 * 60 * 1000L))) // 토큰 유효시각 설정 (12시간) .signWith(SignatureAlgorithm.HS256, secretKey) // 암호화 알고리즘과, secret 값 .compact(); } diff --git a/src/main/java/com/diareat/diareat/config/WebSecurityConfig.java b/src/main/java/com/diareat/diareat/config/WebSecurityConfig.java index 0ef5736..0bd9f3a 100644 --- a/src/main/java/com/diareat/diareat/config/WebSecurityConfig.java +++ b/src/main/java/com/diareat/diareat/config/WebSecurityConfig.java @@ -28,7 +28,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { .and() .authorizeRequests() .antMatchers(AUTH_LIST).permitAll() // swagger 관련 URL은 인증 없이 접근 가능 (테스트용) - .antMatchers("/api/**").permitAll() // 회원가입/로그인 관련 URL은 인증 없이 접근 가능 + .antMatchers("/api/auth/**").permitAll() // 회원가입/로그인 관련 URL은 인증 없이 접근 가능 .anyRequest().authenticated() // 나머지 모든 URL은 Jwt 인증 필요 .and() .addFilterBefore(new JwtAuthFilter(jwtTokenProvider), UsernamePasswordAuthenticationFilter.class);