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 84e5422 commit 936fcd3
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ private static Authentication getAuthentication() {
}

private static CustomAuthenticationToken getCustomAuthenticationToken(Authentication authentication) {
return (CustomAuthenticationToken) authentication.getPrincipal();
// return (CustomAuthenticationToken) authentication.getPrincipal();
Object principal = authentication.getPrincipal();

if (principal instanceof CustomAuthenticationToken) {
return (CustomAuthenticationToken) principal;
} else {
// μ²˜λ¦¬ν•  λ‘œμ§μ΄λ‚˜ μ˜ˆμ™Έλ₯Ό μ²˜λ¦¬ν•˜λŠ” μ½”λ“œλ₯Ό μΆ”κ°€ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
throw new IllegalStateException("Unexpected principal type: " + principal.getClass());
}
}
}

0 comments on commit 936fcd3

Please sign in to comment.