Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 0 additions & 93 deletions src/main/java/com/wooteco/wiki/global/auth/TokenManager.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,16 @@
import com.wooteco.wiki.global.exception.WikiException;
import com.wooteco.wiki.global.auth.JwtTokenProvider;
import com.wooteco.wiki.admin.repository.AdminRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@RequiredArgsConstructor
@Service
public class AuthService {

private final JwtTokenProvider jwtTokenProvider;
private final AdminRepository adminRepository;

public AuthService(
JwtTokenProvider jwtTokenProvider,
AdminRepository adminRepository
) {
this.jwtTokenProvider = jwtTokenProvider;
this.adminRepository = adminRepository;
}

public TokenResponse login(LoginRequest loginRequest) {
Admin admin = adminRepository.findOneByLoginIdAndPassword(loginRequest.loginId(), loginRequest.password())
.orElseThrow(() -> new WikiException(ErrorCode.ADMIN_NOT_FOUND));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ void createToken_success_byTokenInfoResponse() {

// then
assertThat(tokenResponse).isNotNull();
System.out.println(tokenResponse);
}
}

Expand All @@ -66,7 +65,6 @@ void login_success_byExistingAdmin() {

// then
assertThat(tokenResponse).isNotNull();
System.out.println(tokenResponse);
}

@DisplayName("존재하지 않는 어드민 정보로 요청했을 때 예외 발생한다. : WikiException.ADMIN_NOT_FOUND")
Expand Down
Loading