Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#932 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
typescript

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
TypeScript
Stelle
4
Fork
0
Merge medio
14h 50m
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Garvan-Data-Science-Platform/ctrl

Tutte le issue di Garvan-Data-Science-Platform/ctrl

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.