-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/mission 09/제로 #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 제로/main
Are you sure you want to change the base?
The head ref may contain hidden characters: "feature/mission-09/\uC81C\uB85C"
Conversation
soyun0318
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
관리자 권환 확인까지 추가한 게 좋은 것 같아요!
KateteDeveloper
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
구글 로그인 api 연동을 너무 잘해주셨습니다! 너무 수고 많으셨습니다:)
ywkim1m
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
구현 깔끔하게 잘해주신 것 같습니다! 수고하셨습니다!!
suyeon0421
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isLogin을 미들웨어로 따로 임포트해서 구현하는 방법 넘 좋은 것 같아요 !! 수고하셨습니다~!!
hyeeon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API 적용 잘 해주신 것 같아요 수고 많으셨어요!!
Hminkyung
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9주차 미션까지 수행하느라 고생많으셨씁니다!!!! 이제 한주 남았으니까 한주동안 화이팅 해봅시다!! 배포 화이팅!!!!
| } | ||
| }), | ||
| // 기존 선호 카테고리 삭제 | ||
| prisma.userPreference.deleteMany({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prisma에 올바르게 접근하기 위해서는 prisma와 동일한 모델명을 작성해야 합니다! 근데 현재 내부 트랜잭션에서
prisma.userPreference.deleteMany()
prisma.userPreference.createMany()
이렇게 작성되고 있는데 전부 모델명이 잘못되어서 실행이 안됩니다! 모두 userPregerence -> userFavorCategory로 이름을 통일하는 형식으로 진행이 되어야 해요!
| data: { | ||
| email, | ||
| name: profile.displayName, | ||
| gender: "추후 수정", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prisma 스키마에서 제로가 정의한 gender는 enum이 아니라 string이에요! String이라 오류는 나지 않지만 서비스 로직 전체가 Male, Female, Other 형태로 가는데 Google 유저만 문자열 형태가 다릅니다! 이 경우에는 updateUser나 responseDTO에서 불일치 가능성이 높아요!
그리고 preferences도 하나도 안 만들어지고 잇어요!
1.Google 생성시 모든 기본 값을 회원가입과 동일한 형식으로 맞춰야하고
2. preferences =[] 초기화도 필요해요!
3. gender를 enum처럼 관리할거라면 변환도 필요하겠죠!
|
|
||
| throw error; | ||
| } | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
비상 !!!!!!! 아래에 있는 getUserByEmail과 authenticateUser 로 인해 로그인이 절대 성공할 수 없어요! getUserByEmail에서 이미 pw를 제거했기 때문에 user.password는 항상 undefined가 되고 그렇게 되면 비밀번호가 일치하지 않습니다가 항상 발생해요! 그렇다면 로그인은 절대 성공할 수 없겠죠!
const user = await getUserByEmail(email);
-> 여기 부분에서 pw가 제거되고
const isPasswordValid = await comparePasswords(password, user.password);
-> 여기에서 user.pw는 undefined가 되고 있쬬!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
만약에 해결하고 싶다면 excludeSensitiveData 호출을 제거하고
export const getUserByEmail = async (email) => {
const user = await prisma.user.findUnique({ where: { email } });
return user;
};
password 포함 그대로 반환을 하면 될겁니다! 그리고
return excludeSensitiveData(user);
authenticateUser의 마지막에서만 pw 제거하면 됩니다!
🚀 작업한 기능 설명 (Feature Description)
🔍 작업 상세 (Implementation Details)
9주차 미션1
9주차 미션2
9주차 미션3
문서화
인증된 사용자 정보 조회
사용자 정보 수정
🖼️ 이미지 첨부 (Images)
📋 관련 자료 (Related Resources)
📝 추가 정보 (Additional Information)