Skip to content

Commit

Permalink
refactor: 주소 수정, 에러 코드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
yujiyea committed Oct 17, 2024
1 parent f9d5820 commit 84ef4b3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,13 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo

private String makeRedirectUrl(String accessToken, boolean newUser){
if(newUser){ //회원가입한 유저라면 닉네임 입력받는 곳으로 리다이렉트
return UriComponentsBuilder.fromUriString("http://www.madaumc.store/user/signup") //"http://localhost:8080/login/oauth2/code/google"
return UriComponentsBuilder.fromUriString("http://www.madaumc.shop/user/signup")
//return UriComponentsBuilder.fromUriString("http://www.madaumc.store/user/signup") //"http://localhost:8080/login/oauth2/code/google"
.queryParam("token", accessToken)
.build().toUriString();
}
return UriComponentsBuilder.fromUriString("http://www.madaumc.store/user/test") //"http://localhost:8080/login/oauth2/code/google"
return UriComponentsBuilder.fromUriString("http://www.madaumc.shop/user/test")
// return UriComponentsBuilder.fromUriString("http://www.madaumc.store/user/test") //"http://localhost:8080/login/oauth2/code/google"
.queryParam("token", accessToken)
.build().toUriString();
}
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/umc/mada/exception/ControllerAdvice.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ public ResponseEntity<ErrorResponse> testErrorHandler(final ServerInternalExcept
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(errorResponse);
}

@ExceptionHandler(DuplicationItemException.class)
public ResponseEntity<ErrorResponse> duplicateItemHandler(final DuplicationItemException e){
return ResponseEntity.status(HttpStatus.CONFLICT).body(new ErrorResponse(e.getMessage()));
}

// @ExceptionHandler(Exception.class)
// private ResponseEntity<ErrorResponse> unExpectedException(final Exception e){ //TODO: final HttpServletRequest request이거 추가해서 에러로그를 띄우기
// return ResponseEntity.internalServerError().body(new ErrorResponse("예상치 못한 서버 에러가 발생했습니다."));
Expand Down

0 comments on commit 84ef4b3

Please sign in to comment.