Skip to content

feat(auth): implement forgot-password and reset-password endpoints - #4

Open
Hadiqa13 wants to merge 12 commits into
TabiAI:masterfrom
Hadiqa13:feature/forgot-reset-password
Open

feat(auth): implement forgot-password and reset-password endpoints#4
Hadiqa13 wants to merge 12 commits into
TabiAI:masterfrom
Hadiqa13:feature/forgot-reset-password

Conversation

@Hadiqa13

@Hadiqa13 Hadiqa13 commented May 7, 2026

Copy link
Copy Markdown

Files Modified:

  • src/interfaces/auth.interface.ts - Renamed authToken to token
  • src/schemas/auth.schema.ts - Added validation schemas
  • src/controllers/auth.controller.ts - Added controller methods
  • src/routes/auth.routes.ts - Added API routes
  • src/services/auth.service.ts - Implemented business logic
  • prisma/schema.prisma - Added UserTokens model

@Hadiqa13
Hadiqa13 force-pushed the feature/forgot-reset-password branch from a23d99a to c6d9da5 Compare May 13, 2026 10:45
@awoniran
awoniran self-requested a review May 25, 2026 09:44
@Hadiqa13

Copy link
Copy Markdown
Author

@awoniran , could you please submit your review when you get a chance? Your comments are still pending.

…rdToken, rename authToken, fix email validation

@awoniran awoniran left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Make these changes

Comment thread prisma/schema.prisma Outdated
Comment thread prisma/schema.prisma Outdated
Comment thread src/interfaces/auth.interface.ts
Comment thread src/schemas/auth.schema.ts Outdated
Comment thread src/services/auth.service.ts Outdated
Comment thread src/services/auth.service.ts Outdated
Comment thread src/services/auth.service.ts Outdated
Comment thread src/services/auth.service.ts Outdated
Comment thread src/test/health.test.ts Outdated

@awoniran awoniran left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey Hadiqa, re-submitting review.

- Change database provider to PostgreSQL
- Move reset password OTP fields to UserVerifications model
- Update ResetPasswordDTO to use OTP instead of token
- Remove min length validation from email field
- Implement 6-digit OTP generation for forgot password
- Update reset password to verify OTP from UserVerifications table
- Fix deviceId missing in userVerifications.create
@Hadiqa13
Hadiqa13 requested a review from awoniran June 1, 2026 12:04
Comment thread prisma/schema.prisma
Comment thread prisma/schema.prisma Outdated
Comment thread src/helpers/password.ts
@Hadiqa13
Hadiqa13 requested a review from awoniran June 2, 2026 12:08

@awoniran awoniran left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me

- Add admins and AdminTokens models to schema
- Create admin auth service with ACID transaction
- Implement single session enforcement (revoke old tokens)
- Add admin login, verify, logout endpoints
- Register admin routes in server.ts
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.

2 participants