Skip to content

Conversation

@MillicentAmolo
Copy link

title: Password Management
layout: ../layouts/BaseLayout.astro

OnTrack Password Management Implementation

Overview

This documentation explains the implementation of full password management in the OnTrack system under the Capstone project with Thoth Tech.
It includes user registration, password reset via email token, and authenticated password change.

Technologies Used

  • Angular (frontend components, routing, services)
  • Node.js + Express (backend API endpoints)
  • PostgreSQL (database with migration for reset tokens)
  • Visual Studio Code
  • Git (feature/password-management branch)
  • Astro Framework (for documentation)

Key Actions

  • Created backend endpoints for register, forgot password, reset password, and change password.
  • Added database migration for reset_password_token and reset_password_sent_at.
  • Updated sign-in page to include "Forgot Password" link and improved error handling.
  • Built new Angular components: ForgotPassword and ResetPassword.
  • Updated routing (doubtfire.states.ts) and module declarations.
  • Configured email service to send reset links.

Testing Methodology

Manual Testing Approach

The password management functionality was manually tested in a local development container using the Angular app served at localhost:4200.

  • Step 1: Open sign-in page and click “Forgot Password.”
  • Step 2: Enter email address and request reset link.
  • Step 3: Check email inbox for reset link.
  • Step 4: Click link and open reset password form.
  • Step 5: Enter new password and confirm.

Expected Result: Password is updated successfully and user can log in with new credentials.
Actual Result: All steps worked as intended.

This confirms that the password management workflow is functional.

Screenshot (Test Output)

  • Initial home page (no "Forgot Password" link):
    Initial Home

  • Updated home page (with "Forgot Password" link):
    Updated Home

  • Forgot Password form:
    Forgot Password Form

  • Reset email received:
    Reset Email

  • Change password screen:
    Change Password


Conclusion

This implementation delivers a complete password lifecycle for OnTrack users: registration, forgotten password recovery, token-based reset, and authenticated password change.
Future improvements may include automated testing using Angular testing libraries or Cypress.

Notes

This feature improves both security and user experience, ensuring users can recover accounts safely while preventing unauthorized access.

@netlify
Copy link

netlify bot commented Sep 12, 2025

Deploy Preview for ontrackdocumentation failed.

Name Link
🔨 Latest commit fe5a84c
🔍 Latest deploy log https://app.netlify.com/projects/ontrackdocumentation/deploys/68c45558a76b170007609883

Copy link
Contributor

@theiris6 theiris6 left a comment

Choose a reason for hiding this comment

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

Hi Millicent, the document is clean and clear. Nice work! Thanks for the contribution.

Copy link
Contributor

@ibi420 ibi420 left a comment

Choose a reason for hiding this comment

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

Your documentation and images are fine, clear and follow the astro rules. Good work on the documentation.

@WaelAlahamdi
Copy link

Hi @MillicentAmolo

All is good, but add --- before title on the first line to complete the file format and make it work properly.

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.

4 participants