Skip to content
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

Merged
merged 1 commit into from
Apr 14, 2021

Conversation

eliykat
Copy link
Member

@eliykat eliykat commented Apr 13, 2021

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 via syncService.syncProfile, which is updated when syncing.

Code changes

  • use userService.getEmailVerified as the standard interface for checking whether a user's email is verified
  • update this stored emailVerified value when syncing the vault

It'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.

@eliykat eliykat requested a review from a team April 13, 2021 23:14
@eliykat eliykat changed the title Use syncService instead of tokenService to manage emailVerified Use syncService + userService instead of tokenService to manage emailVerified Apr 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants