Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@andrebispo5
Copy link
Contributor

@andrebispo5 andrebispo5 commented Aug 20, 2024

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-9842

📔 Objective

Add services to verify if token received by email is still valid. Can return error if the token is expired or user is already registered.

⏰ 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

@andrebispo5 andrebispo5 changed the title Pm 9842/email verified services [PM-9842] Verify email token services Aug 20, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Aug 20, 2024

Logo
Checkmarx One – Scan Summary & Details84c1a439-d938-4ba5-aa5b-8eddd6bfadba

No New Or Fixed Issues Found

Comment on lines 389 to 390
/// `verifyEmailToken()` performs a request to verify if the verification token received by email is still valid.
func verifyEmailToken() async throws {
Copy link
Member

Choose a reason for hiding this comment

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

🎨 Add test when verifying email is not successful.

Comment on lines +43 to +45
if errorResponse.message.contains("Expired link") {
throw VerifyEmailTokenRequestError.tokenExpired
}
Copy link
Member

Choose a reason for hiding this comment

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

🤔 Does the server send a specific error number or something else we could use instead of the message string? I think this kind of error message comparison is brittle and may be a bit harder to know what's happening if there's an issue because the message changed.

Copy link
Contributor Author

@andrebispo5 andrebispo5 Aug 20, 2024

Choose a reason for hiding this comment

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

I did check it but no:
server
clients

Copy link
Member

Choose a reason for hiding this comment

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

Alright I'll raise it up, thanks for the info! 😄 I'll approve it as is now.

@codecov
Copy link

codecov bot commented Aug 20, 2024

Codecov Report

Attention: Patch coverage is 90.47619% with 2 lines in your changes missing coverage. Please review.

Project coverage is 88.52%. Comparing base (76f791e) to head (ce12d71).
Report is 6 commits behind head on main.

Files Patch % Lines
...API/Account/Requests/VerifyEmailTokenRequest.swift 84.61% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #849   +/-   ##
=======================================
  Coverage   88.51%   88.52%           
=======================================
  Files         606      607    +1     
  Lines       30267    30288   +21     
=======================================
+ Hits        26792    26811   +19     
- Misses       3475     3477    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@andrebispo5 andrebispo5 merged commit 0c98785 into main Aug 20, 2024
@andrebispo5 andrebispo5 deleted the pm-9842/email-verified-services branch August 20, 2024 20:53
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.

2 participants