Skip to content

Commit

Permalink
Merge pull request #116 from TeamSobokSobok/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
dev-Crayon authored Mar 11, 2024
2 parents 67e5cba + fdec5e8 commit 9a843b6
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,12 @@
import io.sobok.SobokSobok.auth.ui.dto.JwtTokenResponse;
import io.sobok.SobokSobok.exception.ErrorCode;
import io.sobok.SobokSobok.exception.model.NotFoundException;
import io.sobok.SobokSobok.friend.infrastructure.FriendQueryRepository;
import io.sobok.SobokSobok.friend.infrastructure.FriendRepository;
import io.sobok.SobokSobok.pill.domain.Pill;
import io.sobok.SobokSobok.pill.infrastructure.PillQueryRepository;
import io.sobok.SobokSobok.pill.infrastructure.PillRepository;
import io.sobok.SobokSobok.pill.infrastructure.PillScheduleQueryRepository;
import io.sobok.SobokSobok.pill.infrastructure.PillScheduleRepository;
import io.sobok.SobokSobok.security.jwt.Jwt;
import io.sobok.SobokSobok.security.jwt.JwtProvider;
import io.sobok.SobokSobok.sticker.infrastructure.LikeScheduleQueryRepository;
import io.sobok.SobokSobok.sticker.infrastructure.LikeScheduleRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.data.redis.core.RedisTemplate;
Expand Down Expand Up @@ -56,8 +52,10 @@ public void logout(Long userId) {
public JwtTokenResponse refresh(String token) {

Authentication authentication = jwtProvider.getAuthentication(token);
String socialId = authentication.getName();

String username = authentication.getName();
User user = userRepository.findByUsername(username)
.orElseThrow(() -> new NotFoundException(ErrorCode.UNREGISTERED_USER));
String socialId = user.getSocialInfo().getSocialId();
if (socialId == null) {
throw new NotFoundException(ErrorCode.UNREGISTERED_TOKEN);
}
Expand Down

0 comments on commit 9a843b6

Please sign in to comment.