Skip to content

Commit

Permalink
chore: log를 추가한다.
Browse files Browse the repository at this point in the history
  • Loading branch information
rlarltj committed May 12, 2024
1 parent f1ab63c commit 49f16f3
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- dev

- feat/**
# 권한 설정
permissions:
contents: read
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class UserControllerV2 {
@DeleteMapping("/me")
public void deleteUser(
@AuthenticationPrincipal JwtAuthentication user,
@Valid UserDeleteRequest deleteRequest
@RequestBody @Valid UserDeleteRequest deleteRequest
) {
userFacadeService.revoke(deleteRequest, user.getId());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package com.moneymong.domain.user.api.request;

import jakarta.validation.constraints.NotBlank;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@AllArgsConstructor
@NoArgsConstructor
public class UserDeleteRequest {
@NotBlank
private String provider;

@NotBlank
private String token;
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
import com.moneymong.global.security.oauth.dto.OAuthUserInfo;
import com.moneymong.global.security.token.repository.RefreshTokenRepository;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.UUID;

@Service
@Slf4j
@RequiredArgsConstructor
public class UserService {

Expand Down Expand Up @@ -53,6 +55,9 @@ public User registerUser(OAuthUserInfo oauthUserInfo) {
);
newUser = save(newUser);

log.info("[UserService] registerUserId = {}", newUser.getId());
log.info("[UserService] refreshToken = {}", oauthUserInfo.getAppleRefreshToken());

if (oauthUserInfo.getAppleRefreshToken() != null) {
appleUserRepository.save(
AppleUser.of(
Expand All @@ -65,7 +70,6 @@ public User registerUser(OAuthUserInfo oauthUserInfo) {
return newUser;
}


@Transactional(readOnly = true)
public UserProfileResponse getUserProfile(Long userId) {
User user = userRepository.findById(userId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,12 @@ private OAuthUserDataResponse decodePayload(String idToken, String nickname, Str
DecodedJWT decoded = JWT.decode(idToken);
Map<String, Claim> claims = decoded.getClaims();

log.info("[AppleService] claims = {}", claims.keySet());
String providerUid = decoded.getSubject();
String email = claims.get("email").asString();
String email = claims.get("sub").asString();

log.info("[AppleService] email = {}", email);
log.info("[AppleService] nickname = {}", nickname);
return OAuthUserDataResponse.builder()
.provider(getAuthProvider().toString())
.oauthId(providerUid)
Expand Down

0 comments on commit 49f16f3

Please sign in to comment.