diff --git a/public/Clicking-the-Reset-Link.PNG b/public/Clicking-the-Reset-Link.PNG new file mode 100644 index 00000000..66c618b4 Binary files /dev/null and b/public/Clicking-the-Reset-Link.PNG differ diff --git a/public/Initial-home-page.PNG b/public/Initial-home-page.PNG new file mode 100644 index 00000000..a477375c Binary files /dev/null and b/public/Initial-home-page.PNG differ diff --git a/public/NEW-COMPONENTS.jpg b/public/NEW-COMPONENTS.jpg new file mode 100644 index 00000000..736f7a61 Binary files /dev/null and b/public/NEW-COMPONENTS.jpg differ diff --git a/public/ROUTING-DOUBTFIRE-STATES.PNG b/public/ROUTING-DOUBTFIRE-STATES.PNG new file mode 100644 index 00000000..8b53dc4e Binary files /dev/null and b/public/ROUTING-DOUBTFIRE-STATES.PNG differ diff --git a/public/Reset-email-link-received.PNG b/public/Reset-email-link-received.PNG new file mode 100644 index 00000000..41f087ea Binary files /dev/null and b/public/Reset-email-link-received.PNG differ diff --git a/public/Updated-home-page-with-forgot-password-link.PNG b/public/Updated-home-page-with-forgot-password-link.PNG new file mode 100644 index 00000000..dd3a722d Binary files /dev/null and b/public/Updated-home-page-with-forgot-password-link.PNG differ diff --git a/public/backend-endpoints.PNG b/public/backend-endpoints.PNG new file mode 100644 index 00000000..5d2a7453 Binary files /dev/null and b/public/backend-endpoints.PNG differ diff --git a/public/change-password-screen.PNG b/public/change-password-screen.PNG new file mode 100644 index 00000000..ac302227 Binary files /dev/null and b/public/change-password-screen.PNG differ diff --git a/public/encryption.PNG b/public/encryption.PNG new file mode 100644 index 00000000..711052f0 Binary files /dev/null and b/public/encryption.PNG differ diff --git a/public/ports.PNG b/public/ports.PNG new file mode 100644 index 00000000..72b13e97 Binary files /dev/null and b/public/ports.PNG differ diff --git a/public/sent-code.PNG b/public/sent-code.PNG new file mode 100644 index 00000000..d7f2484d Binary files /dev/null and b/public/sent-code.PNG differ diff --git a/src/pages/Password_management_2025-09_13.md b/src/pages/Password_management_2025-09_13.md new file mode 100644 index 00000000..ab1da13d --- /dev/null +++ b/src/pages/Password_management_2025-09_13.md @@ -0,0 +1,68 @@ +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](../assets/screenshots/Initial-home-page.png) + +- Updated home page (with "Forgot Password" link): + ![Updated Home](../assets/screenshots/Updated-home-page-with-forgot-password-link.png) + +- Forgot Password form: + ![Forgot Password Form](../assets/screenshots/Clicking-the-Reset-Link.png) + +- Reset email received: + ![Reset Email](../assets/screenshots/Reset-email-link-received.png) + +- Change password screen: + ![Change Password](../assets/screenshots/change-password-screen.png) + +--- + +## 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.