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

From Expertiza_Wiki
Jump to navigation Jump to search
(Added Github links)
Line 4: Line 4:
TODO: Describe the objectives of the project and what issues we were attempting to address.
TODO: Describe the objectives of the project and what issues we were attempting to address.
== Files Modified ==
== Files Modified ==
TODO: List all files that were modified and the changes made to them. Include what principle was violated/what the problem was and how the change fixed it.
Changes to <code>password_retrieval_controller.rb</code>:
{| class="wikitable"
! Change !! Rationale !! Commit Link
|-
|Updated <code>check_reset_url</code> method name to <code>check_token_validity</code>
|The method validates that the password reset token is valid and present. The updated method name provides a more functionally descriptive name.
|[https://github.com/expertiza/expertiza/commit/3f9f63ab51e90743dfab0b860574aa9b673f2717 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.
|[https://github.com/expertiza/expertiza/commit/5429abd6fcb39f7bdbb0aaa1813f19c8101d7e25 Commit]
|-
|Change token expiration time to constant in line 41
|This time should not be hardwired; it should be a constant or a parameter.
|[https://github.com/expertiza/expertiza/commit/3f0b51f6f2f106df8338483396a95d4068e39c7f Commit]
|-
|Reload page if email is nil or empty on <code>password_retrieval/forgotten<code> view
|An empty email parameter was causing the send password button to freeze.
|[https://github.com/expertiza/expertiza/commit/70f77ac851b234f840709859dc1ee9d6725c34fc Commit]
|-
|Improve overall comments and rewrite error messages
|The comments and error messages in the controller need to be more meaningful, specific and clear.
|[https://github.com/expertiza/expertiza/commit/1af745dc3b59641cb0266ebe49ee996718381fd0 Commit]
|}
 
== Testing ==
== Testing ==
TODO: Show how the existing testing suite was passing before and after our refactoring - preserving functionality.
TODO: Show how the existing testing suite was passing before and after our refactoring - preserving functionality.

Revision as of 19:20, 25 October 2022

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