aetheryna / google-scraper-ruby

0 stars 0 forks source link

[B002] As a User, I should be able to Register an account #30

Closed aetheryna closed 2 years ago

aetheryna commented 2 years ago

What happened πŸ‘€

Closes #6

Created the registration flow. Created the User model and table to keep track of updated and new users. Using Bcrypt to hash passwords to the database.πŸ‘·πŸΎ

βœ… Added Bcrypt πŸ”’ βœ… Created User table πŸ“š βœ… Created User model βœ… Added validation messages πŸ’­ βœ… Made Registration flow πŸš„

Insight πŸ“

Used Bcrypt to make the password hashing and take care of most of the work such as confirming password matching. Added a has_secure_password to the user model file to handle that. Bcrypt creates 2 virtual fields for this; password, password_confirmation. Using this on the form allows the application to have suitable validation.

Screen Shot 2565-09-14 at 5 26 17 PM

All validation is being handled by this.

In terms of the registration flow, a user sends a Post request from the UI to the Backend and will be processed via params. This will also be checked by the backend to ensure that only the username, password and password_confirmation is allowed through with a private function defined at the bottom of the file.

Screen Shot 2565-09-14 at 5 30 03 PM

When the correct parameters are sent and verified by the backend then the create function is invoked creating the User and adding them to the database with a hashed password

Screen Shot 2565-09-14 at 5 33 47 PM

Proof Of Work πŸ“Ή

Show us the implementation: screenshots, GIFs, etc.

github-actions[bot] commented 2 years ago

Code coverage is now at 0.00% (0/68 lines)

Generated by :no_entry_sign: Danger