Skip to content

Conversation

Dilinaraveen
Copy link

Summary

Implements password reset flow with OTP:

  • POST /api/v1/auth/reset/initiate
  • POST /api/v1/auth/reset/complete

Details

  • OTP stored in Redis (TTL 10m, one-time use, basic rate limit)
  • Emails delivered via existing EmailService
  • Passwords updated in Firestore using BCrypt
  • Added spring-boot-starter-validation
  • springdoc upgraded for Boot 3.5 compatibility (if applicable)

Config

  • Added application-local.example.properties (no secrets)
  • .gitignore excludes application-local.properties

Testing

  • Postman steps included:
    1. POST /api/v1/auth/reset/initiate { "email": "" } -> 204
    2. Receive OTP (email or Redis GET), then
      POST /api/v1/auth/reset/complete { "email":..., "otp":"123456", "newPassword":"..." } -> 204
  • Verified Firestore password hash updated, Redis key deleted, mail sent.

Security

  • Avoids user enumeration (initiate always 204, complete 400 on bad OTP)
  • BCrypt hashing everywhere for new/updated passwords
  • No secrets committed; docs show env-based setup

Closes #3

@Value("${firebase.credentials.path:${FIREBASE_ADMIN_SA_PATH:}}")
private String credentialsPath;

@Value("${firebase.project-id:${FIREBASE_PROJECT_ID:}}")
Copy link
Contributor

Choose a reason for hiding this comment

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

Please explain why the FirestoreService.java was delete?

@Prathamesh-007
Copy link
Contributor

Also, where is OTP getting generated?

@Prathamesh-007
Copy link
Contributor

Closing the PR since no explanation provided. Happy hacking!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Reset Password Service

2 participants