이슈 내용
static method getUsername은 static context에서 참조할 수 없습니다
상세 내용
EmailUserController의 /auth/login api를 작성 시 EmailLoginDto에 대해
getUsername을 인증 코드 안에 담을 경우 뜨는 오류
` @PostMapping("/login")
public ResponseEntity<?> login(@RequestBody EmailLoginDto emailLoginDto) {
String username = EmailLoginDto.getUsername(); //오류
Authentication authentication = authenticationManager.authenticate(
new UsernamePasswordAuthenticationToken(
emailLoginDto.getUsername(),
emailLoginDto.getPassword()
)
);
`
해결 방안
이슈 내용
static method getUsername은 static context에서 참조할 수 없습니다
상세 내용
EmailUserController의 /auth/login api를 작성 시 EmailLoginDto에 대해
getUsername을 인증 코드 안에 담을 경우 뜨는 오류
` @PostMapping("/login")
public ResponseEntity<?> login(@RequestBody EmailLoginDto emailLoginDto) {
String username = EmailLoginDto.getUsername(); //오류
`
해결 방안