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

Jerry - email verification admin accounts #1446

Merged
merged 3 commits into from
Jan 13, 2024

Conversation

jerryren527
Copy link
Contributor

@jerryren527 jerryren527 commented Oct 24, 2023

Description

Screenshot 2023-09-28 at 8 53 11 AM

The main motivation of this PR is to require an actual email and password associated with a real volunteer in the Main HGN app whenever creating an Administrator or Owner account in the Dev environment. This is a security measure to provide an identity, in the form of a real email address, to otherwise anonymous Administrator and Owner accounts in the Dev environment.

Related PRS (if any):

Main changes explained:

  • Conditionally render input fields for Actual Email and Actual Password whenever role value equals ‘Administrator’ or ‘Owner’
  • Added Error messages and Form Error messages that direct user’s attention to the Actual Email and Actual Password fields whenever invalid credentials are provided.

How to test:

  1. Check into back end branch. Follow the instructions to run the back end branch locally.
  2. check into current branch
  3. do npm install and ... to run this PR locally
  4. log as admin user
  5. Other Links -> User Management -> Create New User
  6. Select 'Administrator' Role, and provide the actual email address and actual password for your account on the Main HGN app.
  7. Note that currently, there is no way to create 'Owner' role. However, if 'Owner' option were available, the above steps would still apply to it.

Screenshots or videos of changes:

admin.accounts.need.email.validation.demo.mp4

Note:

Please try creating users of other roles as well to see if that breaks the app. Thanks!

Conditionally render betaEmail and betaPassword input fields if role
is "Administrator"
Added formErrors for Actual Email and Password inputs to better show the
user to address the problem there.
Copy link
Contributor

@DavidC0126 DavidC0126 left a comment

Choose a reason for hiding this comment

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

Hi @jerryren527 I tested this PR with BE PR#582 and they both work as intended.

actualEmail

Uploading createUserAdmin.mov…

Copy link
Contributor

@navneeeth navneeeth left a comment

Choose a reason for hiding this comment

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

Hello, @jerryren527! I tested your PR along with the related BE and it works as expected! Great implementation!

  • Checked into the current branches, logged in as Owner, navigated to Other Links -> User Management and tested the Create New User functionality by attempting to create an user with an Administrator user role.

  • The actual email and actual password fields validate the input properly and do not allow me to create an user with an Administrator user role if either the actual email or the actual password is incorrect.

  • The error messages displayed are as expected.

  • Verified in the database if the actual email field is reflected for the newly created user with the Administrator user role.

Testing Video:

1446.+.582.mp4

Copy link
Contributor

@malikjahanzaib malikjahanzaib left a comment

Choose a reason for hiding this comment

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

Hi @jerryren527, everything looks good to me in this PR. I was only able to create an admin account when correct actual HGN main credentials were provided. Confirmed in the DB as well. Loved the implementation. Great job!

Test rec:

27.10.2023_22.50.19_REC.mp4

Copy link
Contributor

@Shuhua-L Shuhua-L left a comment

Choose a reason for hiding this comment

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

Hey @jerryren527 I've tested both of your PRs, and they worked as expected. Nice work!

After logging in as an admin, I tested the 'Create New User' feature, and here are the results:

  • Successfully created a new Volunteer user without providing actual HGN account credentials
  • Creating an Admin user with correct credentials will succeed; otherwise, error messages will appear in the top-right corner
FE.1446+BE.582.mov

Copy link
Contributor

@Alforoan Alforoan left a comment

Choose a reason for hiding this comment

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

It worked as intended. Nice!

pr.review.1446.mp4

@one-community
Copy link
Member

Thank you all, moving to final review.

Copy link

@ramyaram2092 ramyaram2092 left a comment

Choose a reason for hiding this comment

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

Good job on the functionality @jerryren527 ! The code looks good

1446-582.mp4

@one-community
Copy link
Member

Thank you all, merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants