Problem
Authentication is the most critical path in the application and has zero test coverage. Bugs in password hashing, JWT signing, or token validation could expose user accounts.
Proposed Solution
Create backend/src/opsce/auth/auth.service.spec.ts covering all auth flows with mocked dependencies.
Acceptance Criteria
Problem
Authentication is the most critical path in the application and has zero test coverage. Bugs in password hashing, JWT signing, or token validation could expose user accounts.
Proposed Solution
Create
backend/src/opsce/auth/auth.service.spec.tscovering all auth flows with mocked dependencies.Acceptance Criteria
register()— success path creates user with hashed password, throwsConflictExceptionon duplicate emaillogin()— success returns access and refresh tokens, throwsUnauthorizedExceptionfor wrong passwordrefreshToken()— valid token returns new token pair, invalid token throwsUnauthorizedExceptionforgotPassword()— creates reset token and callsMailerService.sendPasswordReset()resetPassword()— updates password, throwsBadRequestExceptionfor expired tokenbcryptjs.compareandJwtService.signare mocked — no real crypto in unit testsAuthService