Description
Problem
A user is allowed to change their email address in their Topcoder profile. When that happens, we are not updating the email registered against their account in Vanilla the next time they visit the forums.
Untitled.mov
Expectation
If a user changes their email address on their Topcoder profile, the next time they visit https://discussions.topcoder.com
, their account should be updated with the new email address.
Solution
The current account sync happens in the forums plugin. When a user logs in, we check if we already have a user account for them here:
If we don't, then we create the user account, with their email address
If we do, then we use the user account, without updating it, other than ensuring that the roles are synced:
To fix the email issue, we should add a syncTopcoderEmail
function, similar to syncTopcoderRoles
that syncs the email address from the JWT to the user model, ensuring that the email address is kept in-sync.