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

Auth/PM-5092 - Registration with Email verification - Send Email Verification Endpoint #4173

Merged

Conversation

JaredSnider-Bitwarden
Copy link
Contributor

@JaredSnider-Bitwarden JaredSnider-Bitwarden commented Jun 10, 2024

๐ŸŽŸ๏ธ Tracking

PM-5092

Associated clients PR: bitwarden/clients#9573

๐Ÿ“” Objective

To create a new endpoint to service the new email verification step in the new registration process.

โฐ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

๐Ÿฆฎ Reviewer guidelines

  • ๐Ÿ‘ (:+1:) or similar for great changes
  • ๐Ÿ“ (:memo:) or โ„น๏ธ (:information_source:) for notes or general info
  • โ“ (:question:) for questions
  • ๐Ÿค” (:thinking:) or ๐Ÿ’ญ (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • ๐ŸŽจ (:art:) for suggestions / improvements
  • โŒ (:x:) or โš ๏ธ (:warning:) for more significant problems or concerns needing attention
  • ๐ŸŒฑ (:seedling:) or โ™ป๏ธ (:recycle:) for future improvements or indications of technical debt
  • โ› (:pick:) for minor or nitpick changes

JaredSnider-Bitwarden and others added 23 commits June 4, 2024 19:31
โ€ฆ remove modelState invalid check as .NET literally executes this validation pre-method execution.
โ€ฆustom email for registration verify email.
Copy link

codecov bot commented Jun 10, 2024

Codecov Report

Attention: Patch coverage is 95.31250% with 6 lines in your changes missing coverage. Please review.

Project coverage is 40.68%. Comparing base (b5241f1) to head (a9d0b99).
Report is 6 commits behind head on main.

Files Patch % Lines
...kenables/RegistrationEmailVerificationTokenable.cs 89.28% 2 Missing and 1 partial โš ๏ธ
...re/Services/NoopImplementations/NoopMailService.cs 0.00% 3 Missing โš ๏ธ
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4173      +/-   ##
==========================================
+ Coverage   40.60%   40.68%   +0.07%     
==========================================
  Files        1232     1239       +7     
  Lines       59518    59492      -26     
  Branches     5470     5434      -36     
==========================================
+ Hits        24170    24206      +36     
+ Misses      34208    34160      -48     
+ Partials     1140     1126      -14     

โ˜” View full report in Codecov by Sentry.
๐Ÿ“ข Have feedback on the report? Share it here.

This comment was marked as off-topic.

โ€ฆhe 2 params which should have been nullable based on the constructor logic (2) Add new ReferenceEventType.cs for email verification register submit (3) Update AccountsController.cs to log new reference event (4) Update tests
โ€ฆpose, and token id to include registration to differentiate it from the existing email verification token.
@JaredSnider-Bitwarden JaredSnider-Bitwarden changed the title Auth/pm 5092/email verification send email endpoint Auth/PM-5092 - Registration with Email verification - Send Email Verification Endpoint Jun 13, 2024
@JaredSnider-Bitwarden JaredSnider-Bitwarden marked this pull request as ready for review June 13, 2024 02:31
@JaredSnider-Bitwarden
Copy link
Contributor Author

After addressing all PR feedback, I ran through the 4 primary test scenarios for the endpoint again using web.

@@ -4,9 +4,11 @@ namespace Bit.Core.Auth.Models.Mail;

public class RegisterVerifyEmail : BaseMailModel
{
public string Url => string.Format("{0}/finish-signup?token={1}",
public string Url => string.Format("{0}/finish-signup?token={1}&email={2}",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding email to URL so that the registration finish component can have access to email in order to create a master key once the user enters their MP.

audreyality

This comment was marked as resolved.

Copy link
Contributor

@audreyality audreyality left a comment

Choose a reason for hiding this comment

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

One recommendation, but it's by no means required.

src/Core/Tools/Enums/ReferenceEventSource.cs Show resolved Hide resolved
@JaredSnider-Bitwarden
Copy link
Contributor Author

Merging as all the new changes are feature flagged.

@JaredSnider-Bitwarden JaredSnider-Bitwarden merged commit b2b1e3d into main Jun 19, 2024
50 checks passed
@JaredSnider-Bitwarden JaredSnider-Bitwarden deleted the auth/pm-5092/email-verification-send-email-endpoint branch June 19, 2024 17:54
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.

None yet

3 participants