Skip to content

/auth/login 오류 #21

@pcochoco

Description

@pcochoco

이슈 내용

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()
            )
    );

`

해결 방안

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions