Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add devise #9

Merged
merged 31 commits into from
Oct 5, 2023
Merged

Feature/add devise #9

merged 31 commits into from
Oct 5, 2023

Conversation

ClaudiaRojasSoto
Copy link
Owner

Add Devise for User Authentication

Description

This pull request adds the Devise gem to the application to manage user registration and authentication. Devise provides a flexible and secure way to handle user accounts. This ensures that users can register, confirm their emails, and reset their passwords.

General Requirements

  • No linter errors
  • Used correct Gitflow
  • Work is well-documented

Ruby Requirements

  • Followed all best practices for Ruby as per guidelines.

Project Requirements

  • Removed current_user method from ApplicationController as Devise provides one.
  • Installed and set up Devise.
  • Users can register a new account.
  • Users can log in with a combination of email and password.
  • Hashed passwords are being stored in the database.
  • Email confirmation upon registration.
  • Users can reset their passwords.
  • Modified Devise views for registration and login to match the wireframes and styling.

How to Test

  1. Clone the feature branch into your local machine.
  2. Run bundle install to install the Devise gem.
  3. Run rails db:migrate to apply the new Devise-related database migrations.
  4. Start the Rails server.
  5. Go to the registration and login pages to check if they match the wireframes and your styling.

Please, review the changes made on this feature and give me feedback to improve my app. Thank you in advance.

Contributors

@ClaudiaRojasSoto
@Dachrono

@ClaudiaRojasSoto ClaudiaRojasSoto added the enhancement New feature or request label Oct 4, 2023
Copy link

@Felix45 Felix45 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ClaudiaRojasSoto & @Dachrono ,

Good job so far!
There are some issues that you still need to work on to go to the next project but you are almost there!

Highlights ✔️

  • Devise gem is used for authentication ✅
  • Git flow is used correctly ✅
  • Pull request has a descriptive title and summary ✅
  • Repository has a professional readme file ✅

Required Changes ♻️

Check the comments under the review.

Optional suggestions

Every comment with the [OPTIONAL] prefix is not crucial enough to stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better.

You can also consider:

Cheers and Happy coding!👏👏👏

Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me in your question so I can receive the notification.

Please, do not open a new Pull Request for re-reviews. You should use the same Pull Request submitted for the first review, either valid or invalid unless it is requested otherwise.


As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.

@@ -0,0 +1,40 @@
<h2 class="index-title">Sign up</h2>

<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { class: 'post-form' }) do |f| %>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • [ Required ] I think it would be nice if you make the registration form work as expected, currently, when I fill in all the fields and click on the Sign Up button I get the error below. Please see the screenshot below and rectify this.

Screenshot

I get this error even after filing the name field, kindly rectify this.

Screenshot from 2023-10-04 22-22-41

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!, Thank you.

Comment on lines 3 to 24
<%= form_for(resource, as: resource_name, url: session_path(resource_name), html: { class: 'post-form' }) do |f| %>
<div class="field">
<%= f.label :email, class: 'label-fixed-width' %> <!-- Agrega la nueva clase aquí -->
<%= f.email_field :email, autofocus: true, autocomplete: "email", class: 'post-form textarea' %>
</div>

<div class="field">
<%= f.label :password, class: 'label-fixed-width' %> <!-- Agrega la nueva clase aquí -->
<%= f.password_field :password, autocomplete: "current-password", class: 'post-form textarea' %>
</div>

<% if devise_mapping.rememberable? %>
<div class="field">
<%= f.check_box :remember_me %>
<%= f.label :remember_me, class: 'label-fixed-width' %> <!-- Agrega la nueva clase aquí si es necesario -->
</div>
<% end %>

<div class="actions">
<%= f.submit "Log in", class: 'post-form button' %>
</div>
<% end %>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • [ Required ] I think it would be nice if the design for your login form is consistent with the wireframe provided for this milestone. Currently, your design varies from the wireframe in the following ways.

    • In the wireframe, the username, password, and login buttons have the same width while in your design the fields have varied lengths.
    • The username and password fields in the wireframe have placeholder text while the input fields in your design don't have placeholder texts.

Your design

Screenshot from 2023-10-04 22-26-12

Project Wireframe

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!, Thank you.

@@ -0,0 +1,40 @@
<h2 class="index-title">Sign up</h2>

<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { class: 'post-form' }) do |f| %>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • [ Required ] I think it would be nice if your design for the registration form is similar to the one provided for the Sign In form in the project wireframe. Currently, your design varies from the wireframe in the following ways.

    • In the wireframe, the name, email, password, and login buttons have the same width while in your design the fields have varied lengths.
    • The input fields in the wireframe have placeholder text while the input fields in your design don't have placeholder text.

Your design

Screenshot from 2023-10-04 22-51-37

Project wireframe

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, Thank you.

…r before action to fix the issue with the name on the sign up
Copy link

@AmaduKamara AmaduKamara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Status: Approved 🟢 🟢 🟢

Hi @ClaudiaRojasSoto,

Good job working on the changes highlighted by the previous reviewer 👍🏽

Your project is complete! There is nothing else to say other than... it's time to merge it: ship it:
Congratulations! 🎉

Highlights:

✅ You set up Gitflow correctly 👍🏽
✅ The Linter checks passed successfully 👍🏽
✅ Used devise correctly as expected 👍🏽
✅ Sign up and Login UI designed nicely as expected 👍🏽
✅ Good communication with the reviewer 👍🏽
✅ Good descriptive PR and commit messages 👍🏽

Cheers, and Happy coding!👏👏👏

Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me in your question so I can receive the notification.


As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.

@ClaudiaRojasSoto ClaudiaRojasSoto merged commit f38b6c1 into develop Oct 5, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants