Skip to content

Commit

Permalink
🐛[fix]: DB에 인코딩된 token값이 들어가서 비즈니스 로직 진행 중 디코딩된 uid와 비교할 수가 없음. uid 자…
Browse files Browse the repository at this point in the history
…체가 저장되도록 수정
  • Loading branch information
Hyesooo committed Nov 5, 2023
1 parent 7dc8016 commit fcee3ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@NoArgsConstructor
@Getter
public class FBUserRequestDto {
private String uid;
private String token;
private String fcm;
private String email;
private String nickname;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.pingpong.quoteBakery.sys.service;

import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseAuthException;
import com.pingpong.quoteBakery.app.persistence.LikeRepository;
import com.pingpong.quoteBakery.app.persistence.UserPreferenceRepository;
import com.pingpong.quoteBakery.com.converter.CommonConverter;
Expand Down Expand Up @@ -33,11 +35,11 @@ public class UserService {
private final LikeRepository likeRepository;

@Transactional
public UserDto saveByFireBase(FBUserRequestDto userReqDto) {
public UserDto saveByFireBase(FBUserRequestDto userReqDto) throws FirebaseAuthException {
String randRmk = makeRandomRmk();

User user = userRepository.save(User.builder()
.uid(userReqDto.getUid())
.uid(FirebaseAuth.getInstance().verifyIdToken(userReqDto.getToken()).getUid())
.fcm(userReqDto.getFcm())
.email(userReqDto.getEmail())
.nickname(userReqDto.getNickname())
Expand Down

0 comments on commit fcee3ef

Please sign in to comment.