From 00812cb9aea16fd942bbef35eaf59e8f5a5e369e Mon Sep 17 00:00:00 2001 From: Ganghee-Lee-0522 Date: Sat, 13 Jan 2024 04:47:03 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20CORS=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 서비스 코드를 수정하였습니다. --- .../committersserver/auth/config/AuthenticationUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/committers/snowflowerthon/committersserver/auth/config/AuthenticationUtils.java b/src/main/java/com/committers/snowflowerthon/committersserver/auth/config/AuthenticationUtils.java index 5103195..e1886fa 100644 --- a/src/main/java/com/committers/snowflowerthon/committersserver/auth/config/AuthenticationUtils.java +++ b/src/main/java/com/committers/snowflowerthon/committersserver/auth/config/AuthenticationUtils.java @@ -1,5 +1,6 @@ package com.committers.snowflowerthon.committersserver.auth.config; +import com.committers.snowflowerthon.committersserver.domain.member.entity.Member; import com.committers.snowflowerthon.committersserver.domain.member.entity.Role; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; @@ -25,7 +26,7 @@ public static Long getMemberId() { Authentication authentication = getAuthentication(); if (authentication != null) { - return Long.valueOf(getCustomAuthenticationToken(authentication).getMemberId()); + return ((Member) getCustomAuthenticationToken(authentication).getPrincipal()).getId(); } // 커스텀 필요 throw new UsernameNotFoundException("Member ID not found in the current Authentication context");