event 서비스 설정파일 충돌 수정
This commit is contained in:
@@ -32,4 +32,7 @@ dependencies {
|
||||
// Jackson for JSON
|
||||
api 'com.fasterxml.jackson.core:jackson-databind'
|
||||
api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
|
||||
|
||||
// Swagger/OpenAPI
|
||||
api 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0'
|
||||
}
|
||||
|
||||
@@ -56,13 +56,14 @@ public class JwtTokenProvider {
|
||||
* @param roles 역할 목록
|
||||
* @return Access Token
|
||||
*/
|
||||
public String createAccessToken(UUID userId, UUID storeId, String email, String name, List<String> roles) {
|
||||
|
||||
public String createAccessToken(Long userId, Long storeId, String email, String name, List<String> roles) {
|
||||
Date now = new Date();
|
||||
Date expiryDate = new Date(now.getTime() + accessTokenValidityMs);
|
||||
|
||||
return Jwts.builder()
|
||||
.subject(userId.toString())
|
||||
.claim("storeId", storeId.toString())
|
||||
.claim("storeId", storeId != null ? storeId.toString() : null)
|
||||
.claim("email", email)
|
||||
.claim("name", name)
|
||||
.claim("roles", roles)
|
||||
@@ -112,8 +113,9 @@ public class JwtTokenProvider {
|
||||
public UserPrincipal getUserPrincipalFromToken(String token) {
|
||||
Claims claims = parseToken(token);
|
||||
|
||||
UUID userId = UUID.fromString(claims.getSubject());
|
||||
UUID storeId = UUID.fromString(claims.get("storeId", String.class));
|
||||
Long userId = Long.parseLong(claims.getSubject());
|
||||
String storeIdStr = claims.get("storeId", String.class);
|
||||
Long storeId = storeIdStr != null ? Long.parseLong(storeIdStr) : null;
|
||||
String email = claims.get("email", String.class);
|
||||
String name = claims.get("name", String.class);
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
@@ -24,12 +24,12 @@ public class UserPrincipal implements UserDetails {
|
||||
/**
|
||||
* 사용자 ID
|
||||
*/
|
||||
private final UUID userId;
|
||||
private final Long userId;
|
||||
|
||||
/**
|
||||
* 매장 ID
|
||||
*/
|
||||
private final UUID storeId;
|
||||
private final Long storeId;
|
||||
|
||||
/**
|
||||
* 사용자 이메일
|
||||
|
||||
Reference in New Issue
Block a user