This repository has been archived by the owner on Jun 17, 2022. It is now read-only.
Use syncService + userService instead of tokenService to manage emailVerified #344
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Objective
Fixes a defect in bitwarden/web#915: when a user verifies their email, they must log out and log back in again for the client to recognise the changes. This was confirmed to affect the desktop client, but in theory should affect others as well.
This is because I was using
tokenService
to check whether the user had verified their email, but the token is not updated when syncing the vault. However, we can get the same information viasyncService.syncProfile
, which is updated when syncing.Code changes
userService.getEmailVerified
as the standard interface for checking whether a user's email is verifiedemailVerified
value when syncing the vaultIt's a bit of a chore to go back and change this, but I think the behaviour will be more in line with user expectations, and it'll structure it nicely for any other features we want to require email verification for.
Once this is merged, I'll submit PRs to update all the Angular clients. I'll also update mobile so that we have consistent implementation across the board.