Improve email verification flow and error handling
- Send verification email before creating user to prevent orphaned accounts - Detect SMTP authentication errors and fail fast without retries - Add field-level validation errors for better frontend UX - Configure docker-compose with explicit environment variables - Document dollar sign escaping in .env.example (use $$) - Implement welcome email on successful verification - Clean up unnecessary comments
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package repositories
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"apocapoc-api/internal/domain/entities"
|
||||
)
|
||||
|
||||
type PasswordResetTokenRepository interface {
|
||||
Create(ctx context.Context, token *entities.PasswordResetToken) error
|
||||
FindByToken(ctx context.Context, token string) (*entities.PasswordResetToken, error)
|
||||
Update(ctx context.Context, token *entities.PasswordResetToken) error
|
||||
DeleteExpired(ctx context.Context) error
|
||||
}
|
||||
@@ -12,4 +12,5 @@ type UserRepository interface {
|
||||
FindByEmail(ctx context.Context, email string) (*entities.User, error)
|
||||
FindByVerificationToken(ctx context.Context, token string) (*entities.User, error)
|
||||
Update(ctx context.Context, user *entities.User) error
|
||||
Delete(ctx context.Context, id string) error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user