Skip to content

Commit

Permalink
[6주차] 불필요한 의존성 제거 및 예외 종류 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
sunseo18 committed Dec 7, 2023
1 parent c1e0990 commit 44c2970
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 50 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import com.example.SecondSeminar.common.auth.JwtProvider;
import com.example.SecondSeminar.common.auth.UserAuthentication;
import com.example.SecondSeminar.common.exception.BaseCustomException;
import com.example.SecondSeminar.member.domain.AuthMember;
import com.example.SecondSeminar.member.domain.AuthMemberJpaRepository;
import com.example.SecondSeminar.member.dto.request.AuthMemberRequest;
import com.example.SecondSeminar.member.dto.response.MemberSignInResponse;
import com.example.SecondSeminar.member.exception.MemberException;
import com.example.SecondSeminar.member.exception.MemberExceptionType;
import lombok.RequiredArgsConstructor;
import org.springframework.security.core.Authentication;
Expand Down Expand Up @@ -35,10 +35,10 @@ public String create(AuthMemberRequest request) {

public MemberSignInResponse signIn(AuthMemberRequest request) {
AuthMember authMember = authMemberJpaRepository.findByNickname(request.nickname())
.orElseThrow(() -> new BaseCustomException(MemberExceptionType.NOT_FOUND_MEMBER));
.orElseThrow(() -> new MemberException(MemberExceptionType.NOT_FOUND_MEMBER));

if (!passwordEncoder.matches(request.password(), authMember.getPassword())) {
throw new BaseCustomException(MemberExceptionType.INCORRECT_PASSWORD);
throw new MemberException(MemberExceptionType.INCORRECT_PASSWORD);
}

Authentication authentication = new UserAuthentication(authMember.getId(), null, null);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.example.SecondSeminar.member.presentation;

import com.example.SecondSeminar.common.auth.JwtProvider;
import com.example.SecondSeminar.member.application.AuthMemberService;
import com.example.SecondSeminar.member.dto.request.AuthMemberRequest;
import com.example.SecondSeminar.member.dto.response.MemberSignInResponse;
Expand All @@ -18,7 +17,6 @@
public class AuthMemberController {

private final AuthMemberService authMemberService;
private final JwtProvider jwtProvider;

@PostMapping("sign-up")
public ResponseEntity<Void> signUp(@RequestBody AuthMemberRequest request) {
Expand Down

0 comments on commit 44c2970

Please sign in to comment.