Skip to content

Commit 2519224

Browse files
committed
hotfix : 로그인 수정 후 배포
1 parent a839710 commit 2519224

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
package com.full.moon.domain.user.dto;
22

3-
public record LoginRequest(String token) {
3+
public record LoginRequest(String email) {
44
}

src/main/java/com/full/moon/domain/user/service/SignService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public User saveUser(String email, String domain){
3131
HttpStatus.NOT_FOUND,404,"유저가 존재하지 않습니다. 회원가입이 필요합니다.",new LoginErrorResponse(email,domain));
3232
}
3333

34-
3534
return userRepository.findByEmail(email)
3635
.orElseThrow(()->new CustomException(ErrorCode.USER_NOT_FOUND));
3736
}

src/main/java/com/full/moon/domain/user/service/UserService.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,10 @@ public class UserService {
4040

4141

4242
public TokenResponse loginWithGoogle(LoginRequest request){
43-
GoogleUserResponse googleUserResponse = getUserInfo(request.token());
44-
User user = signService.saveUser(googleUserResponse.getEmail(),domain);
43+
User user = signService.saveUser(request.email(), domain);
4544
return jwtTokenProvider.createToken(user.getId().toString());
4645
}
4746

48-
4947
private GoogleUserResponse getUserInfo(String accessToken) {
5048
String url = "https://www.googleapis.com/oauth2/v2/userinfo";
5149

@@ -63,7 +61,7 @@ private GoogleUserResponse getUserInfo(String accessToken) {
6361
throw new CustomException(ErrorCode.USER_NOT_FOUND);
6462
}
6563
} catch (Exception e) {
66-
throw new CustomException(ErrorCode.KAKAO_USER_ERROR);
64+
throw new CustomException(ErrorCode.GOOGLE_USER_ERROR);
6765
}
6866
}
6967

src/main/java/com/full/moon/global/exception/ErrorCode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public enum ErrorCode {
3939
EXPIRED_REFRESH_TOKEN(UNAUTHORIZED, 400,"만료된 토큰입니다."),
4040
JWT_PARSE_FAILED(BAD_REQUEST,404,"토큰 파싱이 잘못되었습니다."),
4141

42-
KAKAO_USER_ERROR(BAD_REQUEST,404,"카카오 유저 정보를 가져오지 못하였습니다."),
42+
GOOGLE_USER_ERROR(BAD_REQUEST,404,"구글 유저 정보를 가져오지 못하였습니다."),
4343
TOKEN_ERROR(HttpStatus.INTERNAL_SERVER_ERROR,500, "토큰을 제대로 생성하지 못하였습니다."),
4444

4545

0 commit comments

Comments
 (0)