-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Implement verify email #35
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
WalkthroughThe pull request implements email verification functionality by introducing new domain events, command handlers, services, and API endpoints. It refactors the email sending service to support multiple email types via templates and integrates token generation for email confirmation, while updating configuration for the development environment and restructuring email-related services. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant API as AuthController
participant Mediator
participant CreateHandler as UserCreatedEventHandler
participant TokenService as TokenGenerationService
participant EmailService
participant Repository as UserRepository
participant VerifyHandler as VerifyEmailCommandHandler
User->>API: POST /register (email, password)
API->>Mediator: Dispatch RegisterCommand
Mediator->>CreateHandler: User created
CreateHandler->>TokenService: GenerateEmailConfirmationTokenAsync
TokenService-->>CreateHandler: token
CreateHandler->>EmailService: SendEmailVerificationAsync(email, token)
EmailService-->>CreateHandler: ✓ sent
CreateHandler-->>API: registration complete
User->>API: GET /verify-email?userId=X&token=Y
API->>Mediator: Dispatch VerifyEmailCommand
Mediator->>VerifyHandler: Handle verification
VerifyHandler->>TokenService: ConfirmEmailAsync(userId, token)
TokenService-->>VerifyHandler: true/false
alt Token valid
VerifyHandler->>Repository: VerifyEmailAsync(userId)
Repository-->>VerifyHandler: ✓ verified
VerifyHandler->>Mediator: Raise EmailVerifiedEvent
Mediator->>EmailVerifiedEventHandler: Email verified
EmailVerifiedEventHandler->>EmailService: SendWelcomeEmailAsync
EmailService-->>EmailVerifiedEventHandler: ✓ sent
VerifyHandler-->>API: 200 Success
else Token invalid
VerifyHandler-->>API: 400 Invalid token
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Areas requiring extra attention:
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Free ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (27)
💤 Files with no reviewable changes (3)
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
Summary by CodeRabbit
New Features
Chores