Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

PasswordResetToken rows are never deleted after use, inconsistent with OTPToken cleanup

Đang mở
#932 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
58/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
typescript
Lĩnh vực
authentication, database

Hướng nghiên cứu

Read application/backend/src/controllers/UsersController.ts around resetPassword, then compare its token handling with AuthController.loginOtp and the OTPToken deletion described in the issue. Decide and implement consistent cleanup for used password-reset tokens; verify the reset flow no longer leaves used rows behind.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

backend question

UsersController.resetPassword in application/backend/src/controllers/UsersController.ts marks a used token via passwordResetTokenRepo.update({ ..., data: { used: true } }) but never deletes the row. Every password reset ever completed sits in the PasswordResetToken table indefinitely, and there's no scheduled cleanup for used or expired tokens either.

Meanwhile, in the same codebase, AuthController.loginOtp explicitly deletes the OTP token on use: await prisma.oTPToken.delete({ where: { id: otp.id } }). So there are two auth tokens with two different retention policies in the same file tree, presumably not deliberately.

Impact:

  • Storage growth is unbounded over time. Probably minor at CTRL's current scale but grows forever.
  • Minor data-exposure surface: a DB dump reveals when each user reset their password (userId + timestamp trails), even after the tokens themselves are used: true and useless for a real reset attempt.
Ngôn ngữ chính
TypeScript
Star
4
Fork
0
Merge trung bình
14 giờ 50 phút
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Garvan-Data-Science-Platform/ctrl

Tất cả issue của Garvan-Data-Science-Platform/ctrl

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.