-
Notifications
You must be signed in to change notification settings - Fork 3
Feature : Cors설정 추가, 이메일 전송 방식 변경 #91
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
Conversation
추후, 다른 서비스에서 이메일 인증이 필요할 때도 가져다가 쓸 수 있음
인증 코드 입력에서 버튼 클릭으로 변경
Walkthrough비밀번호 찾기 및 이메일 인증 기능을 위한 주요 확장 및 리팩토링이 이루어졌습니다. 새로운 요청/응답 DTO가 추가되고, AuthService와 MailService가 비밀번호 재설정 및 이메일 인증 흐름을 지원하도록 변경되었으며, CORS 설정도 보안 구성에 포함되었습니다. AuthController에 관련 엔드포인트가 신설되었습니다. Changes
Sequence Diagram(s)sequenceDiagram
participant 사용자
participant AuthController
participant AuthService
participant MailService
participant Redis
participant UserRepository
사용자->>AuthController: POST /auth/find-password (email)
AuthController->>AuthService: findPassword(request)
AuthService->>UserRepository: 사용자(email) 조회
UserRepository-->>AuthService: 사용자 정보 반환
AuthService->>MailService: sendPasswordMail(userId, email)
MailService->>Redis: 인증 코드 저장 (10분 만료)
MailService->>사용자: 비밀번호 재설정 이메일 발송
AuthService-->>AuthController: FindPasswordResponse 반환
AuthController-->>사용자: 응답 반환
사용자->>AuthController: GET /auth/verify-password-code?email&key
AuthController->>AuthService: changePasswordByEmail(email, key)
AuthService->>UserRepository: 사용자(email) 조회
AuthService->>MailService: verifyCode(userId, key)
MailService->>Redis: 코드 일치 여부 확인 및 삭제
AuthService-->>AuthController: FindPasswordResponse 반환
AuthController-->>사용자: 응답 반환
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
…re/findPassword
작업 내용
변경 사항
→ 모든 Origin, Header, Method 허용 (setAllowedOrigins("*"))
트러블 슈팅
이메일 인증 시 사용자가 인증 코드를 복사/입력하는 UX가 불편함
→ 인증 메일에 포함된 링크 클릭 시 토큰을 자동 처리하도록 로직 변경
프론트엔드 요청 시 CORS 에러 발생
→ Spring Security에서 .cors(Customizer.withDefaults()) 추가 및 CorsConfigurationSource에서 전역 허용 설정
해결해야 할 문제
참고 사항
코드 리뷰 전 확인 체크리스트
type :)Summary by CodeRabbit