Skip to content

fix: remove debug artifacts and fix password reset token log exposure#112

Merged
GitAddRemote merged 2 commits into
mainfrom
fix/ISSUE-99-debug-artifacts
Apr 11, 2026
Merged

fix: remove debug artifacts and fix password reset token log exposure#112
GitAddRemote merged 2 commits into
mainfrom
fix/ISSUE-99-debug-artifacts

Conversation

@GitAddRemote
Copy link
Copy Markdown
Owner

Summary

  • Deletes the GET /auth/test debug endpoint and its bcrypt import from AuthController
  • Replaces the two logger calls in requestPasswordReset() that leaked the raw token and reset URL with a single neutral log: Password reset requested for user ID: X
  • Gates Swagger UI (/api/docs) behind NODE_ENV !== 'production'
  • Removes persistAuthorization: true from Swagger options

Test plan

  • GET /auth/test returns 404
  • POST /auth/forgot-password logs only Password reset requested for user ID: X — no token, no URL
  • Swagger UI loads at /api/docs in development (NODE_ENV=development)
  • Swagger UI is not served when NODE_ENV=production

Closes #99

- Delete GET /auth/test debug endpoint and bcrypt import
- Remove raw reset token and reset URL from application logs; replace
  with neutral 'Password reset requested for user ID: X' log entry
- Gate Swagger UI behind NODE_ENV !== 'production'
- Remove persistAuthorization from Swagger options

Closes #99
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Removes debug/security-sensitive artifacts from the auth flow and limits Swagger UI exposure to non-production environments.

Changes:

  • Removed the GET /auth/test debug endpoint and its bcrypt import from AuthController.
  • Eliminated password reset token/reset-link logging; replaced with a neutral user-ID log line.
  • Mounted Swagger UI only when NODE_ENV !== 'production' and removed persistAuthorization.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
backend/src/modules/auth/auth.service.ts Stops logging password reset token/URL; logs only a neutral request message.
backend/src/modules/auth/auth.controller.ts Deletes the debug bcrypt test endpoint and related import.
backend/src/main.ts Gates Swagger UI to non-production and removes persisted authorization option.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backend/src/main.ts
The Swagger docs URL was being logged unconditionally even when the
UI itself was not mounted in production. Moves the log line inside
the same NODE_ENV !== 'production' guard for consistency.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@GitAddRemote GitAddRemote merged commit 942ed96 into main Apr 11, 2026
13 checks passed
@GitAddRemote GitAddRemote deleted the fix/ISSUE-99-debug-artifacts branch April 11, 2026 23:59
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.

Tech Story: Remove debug artifacts and fix password reset token log exposure

2 participants