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.
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.
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
Proof Of Work πΉ
Show us the implementation: screenshots, GIFs, etc.
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.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
andpassword_confirmation
is allowed through with aprivate
function defined at the bottom of the file.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
Proof Of Work πΉ
Show us the implementation: screenshots, GIFs, etc.