Skip to content
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

feature: 선생님 회원가입 추가 #32

Merged
merged 14 commits into from
May 6, 2024
Merged

Conversation

tlarbals824
Copy link
Contributor

@tlarbals824 tlarbals824 commented May 5, 2024

🗃 Issue

🔥 Task

  • 선생님 회원가입 추가
  • 배치 패키지 구조 변경 (추가로 변경될 예정)
  • 사용자 가입시 학급 코드를 통해 가입할 수 있도록 수정

📄 Reference

  • None

@tlarbals824 tlarbals824 added the ✨ Feature 새로운 기능 label May 5, 2024
@tlarbals824 tlarbals824 requested a review from sominyun May 5, 2024 04:33
@tlarbals824 tlarbals824 self-assigned this May 5, 2024
@tlarbals824
Copy link
Contributor Author

학교 가져오는부분 다시보니까 너무 하드 코딩되어 있어서 리팩터링 해도 괜찮을까? @sominyun

@tlarbals824 tlarbals824 marked this pull request as ready for review May 5, 2024 18:55
Copy link
Member

@sominyun sominyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

batch 리팩토링 한 거 깔끔하고 보기 좋당~~~~~

근데 나 궁금한게 있는데 이게 소셜 로그인은
socialLogin -> input: accessToken, output: accessToken,refreshToken

인데 선생님 로그인은
Login ->input: 아이디, 비밀번호 -> output: accessToken

이잖아
이게 소셜로그인은 프론트에서 accessToken을 넘겨 주고 우리가 refreshToken을 만들어서 주는 거고
선생님로그인은 프론트에서 아이디랑 비밀번호를 넘겨주면 우리가 accessToken을 만들어서 주고 refreshToken은 사용하지 않는 방식인거야?


fun loginTeacher(request: LoginTeacher.Request): LoginTeacher.Response{
val (username, password) = request.convertLoginInfo(passwordEncoder::encode)
val teacher = teacherReader.findByUsernameAndPassword(username, password)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

궁금한게 이거 만약에 유저네임이랑패스워드 없으면 그냥 null 반환되면 예외처리가 어떻게 되는거야???? 그냥 500뜨는거야?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

어어어

val (username, password) = request.convertLoginInfo(passwordEncoder::encode)
val teacher = teacherReader.findByUsernameAndPassword(username, password)
return LoginTeacher.Response(
accessToken = jwtProvider.generateTeacherAccessToken(Claims.TeacherClaims(teacher.id)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
accessToken = jwtProvider.generateTeacherAccessToken(Claims.TeacherClaims(teacher.id)),
accessToken = jwtProvider.generateTeacherAccessToken(Claims.TeacherClaims(teacher.id))

진짜 별거 아닐수도 있는데 저 , 필요없는거겠지..?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 이참에 우리 lint도 설정해둘까

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋지~

@tlarbals824
Copy link
Contributor Author

일단은 선생님의 경우 그렇게 크게 중요한 부분이 아닌것같아서 우선 access token만 반환하도록 만들어뒀어

@tlarbals824 tlarbals824 merged commit b3b67cf into develop May 6, 2024
1 check passed
@tlarbals824 tlarbals824 deleted the feat/#24-create-teacher branch May 6, 2024 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature 새로운 기능
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants