CSC/ECE 517 Fall 2022 - E2252. Refactor auth controller.rb & password retrieval controller.rb

From Expertiza_Wiki
Jump to navigation Jump to search

Overview of Expertiza

TODO: Add description of general expertiza system and how our controllers relate to the overall functionality.

Description of Project

TODO: Describe the objectives of the project and what issues we were attempting to address.

Files Modified

Changes to password_retrieval_controller.rb:

Change Rationale Commit Link
Updated check_reset_url method name to check_token_validity The method validates that the password reset token is valid and present. The updated method name provides a more functionally descriptive name. Commit
Replaced repeated code in lines 35-36 and 62-63 The use of repeated code violates the DRY principle and so it was moved to a new method. Commit
Change token expiration time to constant in line 41 This time should not be hardwired; it should be a constant or a parameter. Commit
Reload page if email is nil or empty on password_retrieval/forgotten view An empty email parameter was causing the send password button to freeze. Commit
Improve overall comments and rewrite error messages The comments and error messages in the controller need to be more meaningful, specific and clear. Commit

Testing

TODO: Show how the existing testing suite was passing before and after our refactoring - preserving functionality.

Relevant Links