Skip to content

Commit

Permalink
πŸ› CORS 였λ₯˜ μˆ˜μ •
Browse files Browse the repository at this point in the history
- μ„œλΉ„μŠ€ μ½”λ“œλ₯Ό μˆ˜μ •ν•˜μ˜€μŠ΅λ‹ˆλ‹€.
  • Loading branch information
Ganghee-Lee-0522 committed Jan 12, 2024
1 parent e953b9d commit 00812cb
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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");
Expand Down

0 comments on commit 00812cb

Please sign in to comment.