Skip to content
Open
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
601cd6f
트리생성 interface 구성
sin-hyunjin Feb 21, 2024
30cee38
트리가 만들어지고 어떤 데이터를 전달해야할지...
sin-hyunjin Feb 22, 2024
edc9379
트리 생성, 리스트 조회, 삭제
sin-hyunjin Feb 23, 2024
28be02e
- creatTree
sin-hyunjin Feb 24, 2024
a222825
treeModify 트리 수정부분 로직작성
sin-hyunjin Feb 25, 2024
2834361
- Tree상세정보 메서드 추가
sin-hyunjin Feb 25, 2024
45c15c3
- Tree상세정보 메서드 추가
sin-hyunjin Feb 25, 2024
a6e56ce
TreeItem Test
sin-hyunjin Feb 27, 2024
b89688b
TreeItem 생성테스트
sin-hyunjin Feb 28, 2024
60a7aab
AppConfig - moddelMapper를 사용하기 위한 config설정
sin-hyunjin Feb 29, 2024
25b9f36
컨트롤러 추가
sin-hyunjin Feb 29, 2024
2f80ed5
트리 리스트 방법 수정 jpa @Query -> modelMapper로 가져오기
sin-hyunjin Feb 29, 2024
c2c12de
OAuth2.md
sin-hyunjin Mar 17, 2024
c5659f7
CustomUserDetails 변경에 따른 CustomUser와 관계있는 로직들 변경
sin-hyunjin Mar 17, 2024
f44dc72
토큰 만료시간 컬럼 추가
sin-hyunjin Mar 17, 2024
46aa786
OAuth2 로그인 후 accessToken 발급후 header 값 토큰 검증 확인
sin-hyunjin Mar 17, 2024
66ab013
OAuth2 유저 로그인시 UserResponseDto객체를 클라이언트에 전송 성공
sin-hyunjin Mar 17, 2024
72a07fe
Tree 수정,리스트,삭제 할시 userId값도 가져오게 수정하였음
sin-hyunjin Mar 17, 2024
ef89cbc
OAuth2 로그인 실패시 핸들러 추가
sin-hyunjin Mar 17, 2024
cb6c9da
- OAuth2 삭제
sin-hyunjin Mar 25, 2024
ada4d13
수정 기능 테스트중 toEntity방식이나 treeEntity접근해서 값을 변경할 시 null값이면 기존정보가 아닌 null…
sin-hyunjin Mar 25, 2024
c39b706
수정기능 modelMapper 방식으로 일단 수정 ..
sin-hyunjin Mar 25, 2024
4383f35
TreeItem CRUD 인자값에 userId 추가
sin-hyunjin Mar 25, 2024
326509e
Swagger3.0 version 추가
sin-hyunjin Mar 27, 2024
663e3bb
h2 DataBase 변경 -> h2 <frame>요소를 사용 비활성화
sin-hyunjin Mar 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,11 @@ dependencies {
implementation("org.springframework.boot:spring-boot-starter-validation")

// PostgreSQL JDBC 드라이버 의존성
// runtimeOnly 'org.postgresql:postgresql'
runtimeOnly 'org.postgresql:postgresql'
// h2
runtimeOnly 'com.h2database:h2'
// runtimeOnly 'com.h2database:h2'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

org.postgresql:postgresql 의존성이 주석 처리되고 com.h2database:h2 의존성이 추가되었습니다. 변경 사항을 확인해야 합니다.

- //	runtimeOnly 'org.postgresql:postgresql'
+ 	runtimeOnly 'org.postgresql:postgresql'
- //	runtimeOnly 'com.h2database:h2'
+ 	//	runtimeOnly 'com.h2database:h2'



// Jakarta Validation API 의존성
// implementation("jakarta.validation:jakarta.validation-api") // 최신 버전 사용 권장

// Spring Security 사용 시 필요한 의존성
implementation("org.springframework.boot:spring-boot-starter-security")

Expand All @@ -58,6 +55,11 @@ dependencies {
// enable production
implementation ("org.springframework.boot:spring-boot-starter-actuator")

// modelmapper
implementation 'org.modelmapper:modelmapper:2.4.4'

// swagger3
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0'
Comment on lines +58 to +62

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

modelmapperswagger3 라이브러리가 추가되었습니다. 새로운 의존성을 확인해야 합니다.

+ 	// modelmapper
+ 	implementation 'org.modelmapper:modelmapper:2.4.4'
+ 
+ 	// swagger3
+ 	implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0'

}


Expand Down
Binary file added screenshots/Oauth2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions src/main/java/com/chukapoka/server/common/authority/AppConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.chukapoka.server.common.authority;


import lombok.RequiredArgsConstructor;
import org.modelmapper.ModelMapper;
import org.modelmapper.convention.MatchingStrategies;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@RequiredArgsConstructor
public class AppConfig {
@Bean
public ModelMapper modelMapper() {
ModelMapper modelMapper = new ModelMapper();
/** 연결 전략 : 같은 타입의 필드명이 같은 경우만 동작 */
modelMapper.getConfiguration().setMatchingStrategy(MatchingStrategies.LOOSE).setSkipNullEnabled(true).setFieldMatchingEnabled(true)
.setAmbiguityIgnored(true) // id속성을 매핑에서 제외
.setFieldAccessLevel(org.modelmapper.config.Configuration.AccessLevel.PRIVATE);
return modelMapper;
}
}
Original file line number Diff line number Diff line change
@@ -1,50 +1,55 @@
package com.chukapoka.server.common.authority;


import com.chukapoka.server.common.authority.jwt.JwtAuthenticationFilter;
import com.chukapoka.server.common.authority.jwt.JwtTokenProvider;
import com.chukapoka.server.common.enums.Authority;
import com.chukapoka.server.common.repository.TokenRepository;
import org.springframework.beans.factory.annotation.Autowired;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;

import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;

@Configuration
@EnableWebSecurity
@RequiredArgsConstructor
public class SecurityConfig {
/**
* Spring Security 6.1.0부터는 메서드 체이닝의 사용을 지양하고 람다식을 통해 함수형으로 설정하게 지향함
*/
@Autowired
private JwtTokenProvider jwtTokenProvider;

@Autowired
private TokenRepository tokenRepository;
private final JwtTokenProvider jwtTokenProvider;
private final TokenRepository tokenRepository;

@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
/** rest api 설정 */
http
.httpBasic(AbstractHttpConfigurer::disable) // 기본 인증 로그인 비활성화
.logout(AbstractHttpConfigurer::disable) // 기본 로그아웃 비활성화
.formLogin(AbstractHttpConfigurer::disable) // 기본 로그인 비활성화
.csrf(AbstractHttpConfigurer::disable) // csrf 비활성화 -> cookie를 사용하지 않으면 꺼도 된다. (cookie를 사용할 경우 httpOnly(XSS 방어), sameSite(CSRF 방어)로 방어해야 한다.)
.sessionManagement(session ->
session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) // 세션관리 정책을 STATELESS(세션이 있으면 쓰지도 않고, 없으면 만들지도 않는다)
.addFilterAfter(new JwtAuthenticationFilter(jwtTokenProvider, tokenRepository), UsernamePasswordAuthenticationFilter.class);

/** request 인증, 인가 설정 */
http
.httpBasic(AbstractHttpConfigurer::disable)
.csrf(AbstractHttpConfigurer::disable)
.addFilterBefore(new JwtAuthenticationFilter(jwtTokenProvider, tokenRepository), UsernamePasswordAuthenticationFilter.class)
.authorizeHttpRequests((authorizeRequests) -> {
authorizeRequests
.requestMatchers("/api/user/emailCheck", "/api/user", "/api/user/authNumber", "/api/health").anonymous()

.requestMatchers("/api/user/logout", "api/user/reissue").hasRole(Authority.USER.getAuthority());// hasAnyRole은 "ROLE_" 접두사를 자동으로 추가해줌 하지만 Authority는 "ROLE_USER"로 설정해야했음 이것떄문에 회원가입할떄 권한이 안넘어갔음
}



);
authorizeRequests
.requestMatchers("/api/user/emailCheck", "/api/user", "/api/user/authNumber","/swagger-ui/**", "/v3/api-docs/**").anonymous()
.requestMatchers("/api/user/logout", "api/user/reissue", "api/tree/**","api/treeItem/**").hasRole(Authority.USER.getAuthority()// hasAnyRole은 "ROLE_" 접두사를 자동으로 추가해줌 하지만 Authority는 "ROLE_USER"로 설정해야했음 이것떄문에 회원가입할떄 권한이 안넘어갔음

);
});
return http.build();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.chukapoka.server.common.authority;

import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.security.SecurityRequirement;
import io.swagger.v3.oas.models.security.SecurityScheme;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/** swagger 의존성만 설정해도 자동 적용되지만, jwt 토큰값을 확인하기 위한 설정 */
@Configuration
public class SwaggerConfig {


/** SwaggerConfig의 openAPI 함수에 security schemes를 추가
* addList 부분과 addSecuritySchemes의 이름 부분은 변경이 가능하지만 둘 다 같은 이름이어야 함 */
@Bean
public OpenAPI openAPI(){
return new OpenAPI().addSecurityItem(new SecurityRequirement().addList("JWT"))
.components(new Components().addSecuritySchemes("JWT", createAPIKeyScheme()))
.info(new Info().title("Chukapoka API")
.description("This is Chukapoka API")
.version("v2.2.0"));
}
/** JWT를 적용하려면 confugure에 JWT SecurityScheme이 필요 */
private SecurityScheme createAPIKeyScheme() {
return new SecurityScheme().type(SecurityScheme.Type.HTTP)
.bearerFormat("JWT")
.scheme("bearer");
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.chukapoka.server.common.authority;
package com.chukapoka.server.common.authority.jwt;

import com.chukapoka.server.common.entity.Token;
import com.chukapoka.server.common.repository.TokenRepository;
Expand All @@ -25,7 +25,6 @@ public class JwtAuthenticationFilter extends GenericFilterBean {

public static final String AUTHORIZATION_HEADER = "Authorization";
public static final String BEARER_PREFIX = "Bearer";

private final JwtTokenProvider jwtTokenProvider;
private final TokenRepository tokenRepository;
Comment on lines 25 to 29

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

The import statement and package declaration seem to be incorrect. Please ensure that the package structure matches the directory structure.

- package com.chukapoka.server.common.authority;
+ package com.chukapoka.server.common.authority.jwt;

- import com.chukapoka.server.common.entity.Token;
+ import com.chukapoka.server.common.authority.jwt.JwtTokenProvider;


Expand All @@ -36,8 +35,6 @@ public class JwtAuthenticationFilter extends GenericFilterBean {
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
// 1. Request Header 에서 토큰을 꺼냄
String accessToken = resolveToken((HttpServletRequest) request);
// String data = tokenRepository.getAccessToken(token);
// System.out.println("data = " + data);
// 2. validateToken 으로 토큰 유효성 검사
// 정상 토큰이면 해당 토큰으로 Authentication 을 가져와서 SecurityContext 에 저장
if (StringUtils.hasText(accessToken)) {
Comment on lines 35 to 40

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

It seems that there are commented-out lines related to accessing data from the token repository. Make sure these lines are removed if they are no longer needed.

-//        String data = tokenRepository.getAccessToken(token);
-//        System.out.println("data = " + data);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.chukapoka.server.common.authority;
package com.chukapoka.server.common.authority.jwt;


import com.chukapoka.server.common.dto.CustomUser;
import com.chukapoka.server.common.dto.CustomUserDetails;
import com.chukapoka.server.common.dto.TokenDto;

import com.chukapoka.server.user.entity.User;
import com.chukapoka.server.user.repository.UserRepository;
import io.jsonwebtoken.*;
import io.jsonwebtoken.io.Decoders;
import io.jsonwebtoken.security.Keys;
Expand All @@ -19,8 +20,10 @@


import java.security.Key;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Optional;
Comment on lines +23 to +26

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

The import statements have been updated with additional imports. Make sure these imports are necessary for the functionality.

+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.Optional;

import java.util.stream.Collectors;


Expand All @@ -35,12 +38,14 @@ public class JwtTokenProvider {
private static final long ACCESS_EXPIRATION_MILLISECONDS = 1000 * 60 * 30;
// Refresh Token 만료 시간 상수 (7일)
private static final long REFRESH_EXPIRATION_MILLISECONDS = 1000L * 60 * 60 * 24 * 7;
private UserRepository userRepository;
private final Key key;
// 비밀 키를 Base64 디코딩한 값으로 초기화
@Autowired
public JwtTokenProvider(@Value("${jwt.secret}") String secretKey) {
public JwtTokenProvider(@Value("${jwt.secret}") String secretKey, UserRepository userRepository) {
byte[] keyBytes = Decoders.BASE64.decode(secretKey);
this.key = Keys.hmacShaKeyFor(keyBytes);
this.userRepository = userRepository;
Comment on lines +41 to +48

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Changes have been made in the constructor of JwtTokenProvider class, including the addition of UserRepository dependency injection. Review if these changes align with the overall design and requirements.

-    public JwtTokenProvider(@Value("${jwt.secret}") String secretKey) {
+    public JwtTokenProvider(@Value("${jwt.secret}") String secretKey, UserRepository userRepository) {

71:
A type casting issue is present in setting the USER_KEY claim. Ensure the correct type is used for casting.

-                .claim(USER_KEY, ((CustomUserDetails) authentication.getPrincipal()).getUserId())
+                .claim(USER_KEY, ((CustomUser) authentication.getPrincipal()).getUserId())

82:
Similar to the previous issue, there is a type casting issue in setting the USER_KEY claim for refreshToken. Verify and correct the type casting.

-                .claim(USER_KEY, ((CustomUserDetails) authentication.getPrincipal()).getUserId())  // user id
+                .claim(USER_KEY, ((CustomUser) authentication.getPrincipal()).getUserId())  // user id

}

/**
Expand All @@ -63,7 +68,7 @@ public TokenDto createToken(Authentication authentication) {
String accessToken = Jwts.builder()
.setSubject(authentication.getName())
.claim(AUTHORITIES_KEY, authorities) // 권한
.claim(USER_KEY, ((CustomUser) authentication.getPrincipal()).getUserId())
.claim(USER_KEY, ((CustomUserDetails) authentication.getPrincipal()).getUserId())
.setIssuedAt(now)
.setExpiration(accessTokenExpiresIn) // 토큰이 만료될시간
.signWith(key, SignatureAlgorithm.HS256) // 비밀키, 암호화 알고리즘이름
Expand All @@ -74,7 +79,7 @@ public TokenDto createToken(Authentication authentication) {
String refreshToken = Jwts.builder()
.setSubject(authentication.getName())
.claim(AUTHORITIES_KEY, authorities) // 권한
.claim(USER_KEY, ((CustomUser) authentication.getPrincipal()).getUserId()) // user id
.claim(USER_KEY, ((CustomUserDetails) authentication.getPrincipal()).getUserId()) // user id
.setIssuedAt(now)
.setExpiration(refreshExpiration)
.signWith(key, SignatureAlgorithm.HS256)
Expand All @@ -83,8 +88,9 @@ public TokenDto createToken(Authentication authentication) {
return TokenDto.builder()
.grantType(BEARER_TYPE)
.accessToken(accessToken)
.accessTokenExpiresIn(accessTokenExpiresIn.getTime())
.refreshToken(refreshToken)
.atExpiration(formatDate(accessTokenExpiresIn))
.rtExpiration(formatDate(refreshExpiration))
Comment on lines 91 to +93

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

The fields atExpiration and rtExpiration are being set using formatDate method. Check if this formatting logic aligns with the expected behavior.

-                 .accessTokenExpiresIn(accessTokenExpiresIn.getTime())
+                 .atExpiration(formatDate(accessTokenExpiresIn))
+                 .rtExpiration(formatDate(refreshExpiration))

.build();
}

Expand All @@ -94,7 +100,6 @@ public TokenDto createToken(Authentication authentication) {
/**
* JWT 토큰에서 사용자 정보를 추출하여 인증 객체를 반환하는 메서드
*/

public Authentication getAuthentication(String token) {
Claims claims = parseClaims(token);

Expand All @@ -112,8 +117,14 @@ public Authentication getAuthentication(String token) {
.map(SimpleGrantedAuthority::new)
.collect(Collectors.toList());

// 데이터베이스에서 사용자 정보 조회
Optional<User> userOptional = userRepository.findById(userId);
if (userOptional.isEmpty()) {
throw new RuntimeException("User not found for id: " + userId);
}
User user = userOptional.get();
// UserDetails 객체 생성
UserDetails principal = new CustomUser(userId, claims.getSubject(), authorities);
UserDetails principal = new CustomUserDetails(user);

// UsernamePasswordAuthenticationToken을 사용하여 Authentication 객체 반환
return new UsernamePasswordAuthenticationToken(principal, "", authorities);
Comment on lines 117 to 130

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Note: This review was outside of the patch, so it was mapped to the patch with the greatest overlap. Original lines [100-127]

There are significant changes in the method getAuthentication, involving the creation of UserDetails object and handling of user information. Review these changes thoroughly to ensure they are implemented correctly.

-        UserDetails principal = new CustomUser(userId, claims.getSubject(), authorities);
+        UserDetails principal = new CustomUserDetails(user);

Expand Down Expand Up @@ -156,6 +167,11 @@ public boolean isTokenExpired(String token) {
Date expirationDate = claims.getExpiration();
return expirationDate != null && expirationDate.before(new Date());
}
/** 토큰 만료기한 날짜 포맷메서드 */
private String formatDate(Date date) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
return dateFormat.format(date);
}
Comment on lines +170 to +174

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

A new private method formatDate has been added for date formatting. Verify if this method is correctly implemented and used.

+    /** 토큰 만료기한 날짜 포맷메서드 */
+    private String formatDate(Date date) {
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
+        return dateFormat.format(date);
+    }



}
22 changes: 0 additions & 22 deletions src/main/java/com/chukapoka/server/common/dto/CustomUser.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
package com.chukapoka.server.common.dto;

import com.chukapoka.server.user.entity.User;
import lombok.Getter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;
import java.util.Collections;

/**
* CustomUserDetails 클래스는 Spring Security에서 제공하는 User 클래스를 확장하여 추가적인 사용자 정보를 저장하기 위한 클래스
* 주로 사용자의 고유한 식별자(ID)를 추가로 저장하고자 할 때 사용
*/
@Getter
public class CustomUserDetails implements UserDetails {

private final User user;

/** 일반 로그인 */
public CustomUserDetails(User user) {
this.user = user;
}

@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
if (user == null) {
return Collections.emptyList(); // user가 null인 경우 빈 권한 목록 반환
}
return Collections.singleton(new SimpleGrantedAuthority(user.getAuthorities()));
Comment on lines +19 to +31

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

getAuthorities() 메서드에서 SimpleGrantedAuthority 생성자에 전달되는 파라미터가 잘못된 것 같습니다. user.getAuthorities()는 권한 목록이 아닌 단일 권한을 반환해야 합니다. 이 부분을 수정해야 합니다.

- return Collections.singleton(new SimpleGrantedAuthority(user.getAuthorities()));
+ return Collections.singleton(new SimpleGrantedAuthority(user.getAuthorities().toString()));

}

public String getEmail() {
return user.getEmail();
}

public Long getUserId() {
return user.getId();
}
Comment on lines +34 to +40

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

getEmail(), getUserId() 메서드가 추가되었지만, 이러한 메서드들은 User 클래스에 이미 존재하는 것으로 보입니다. 중복 정의를 피하기 위해 이러한 메서드들을 제거하고 기존 User 클래스의 메서드를 활용하는 것이 좋습니다.

- public String getEmail() {
-     return user.getEmail();
- }
- 
- public Long getUserId() {
-     return user.getId();
- }


@Override
public String getPassword() {
return user.getPassword();
}

@Override
public String getUsername() {
if (user != null) {
return user.getId().toString();
}
return null; // 사용자 객체가 null인 경우 null 반환
Comment on lines +47 to +52

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

getUsername() 메서드에서 사용자 객체가 null인 경우 null을 반환하도록 되어 있습니다. 이 경우에 대한 처리가 필요한지 확인해야 합니다. 사용자 객체가 null인 경우에 대한 예외 처리나 다른 방법을 고려해야 할 수 있습니다.

+ if (user == null) {
+     return "Unknown";
+ }

}


/** 계정의 만료 여부 반환 (기한이 없으므로 항상 true 반환) */
@Override
public boolean isAccountNonExpired() {
return true;
};
/** 계정의 잠금 여부 반환 (잠금되지 않았으므로 항상 true 반환)*/
@Override
public boolean isAccountNonLocked() {
return true;
}
/** 자격 증명의 만료 여부 반환 (기한이 없으므로 항상 true 반환)*/
@Override
public boolean isCredentialsNonExpired() {
return true;
}
/** 계정의 활성화 여부 반환 (활성화된 계정이므로 항상 true 반환)*/
@Override
public boolean isEnabled() {
return true;
}


}
3 changes: 2 additions & 1 deletion src/main/java/com/chukapoka/server/common/dto/TokenDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class TokenDto {
private String grantType; // JWT에 대한 인증 타입. 여기서는 Bearer를 사용. 이후 HTTP 헤더에 prefix로 붙여주는 타입
private String accessToken;
private String refreshToken;
private Long accessTokenExpiresIn;
private String atExpiration;
private String rtExpiration;
Comment on lines +16 to +17

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

The field names atExpiration and rtExpiration have been added in place of accessTokenExpiresIn. This change seems appropriate for specifying the expiration times for access tokens and refresh tokens.

-    private Long accessTokenExpiresIn;
+    private String atExpiration;
+    private String rtExpiration;


}
Loading