Open tomlovesgithub opened 1 year ago
Hey team! Please add your planning poker estimate with Zenhub @drieJAC @HalcyonJAC @tomlovesgithub @warrensearle
@tomlovesgithub and @warrensearle to refine ticket content
@tomlovesgithub and I have reviewed this ticket and progressed it to ready to play
@nickaddy, @tomlovesgithub and @warrensearle the improvements suggested in this ticket are still relevant:
updateEmailAddress
However the ticket needs further re-writing as the original bug described is no longer a problem.
Also need to make sure the new email address doesnt already exist in the auth db
We can use transactions in firebase to ensure that when writing to multiple sources they either all succeed or all fail to prevent db conflicts
@drieJAC We have already closed up one of the above points with the previous ticket:
Regarding the points around authorisation:
Does this ticket need to be rewritten/customised?
Describe the bug Candidates who use the profile functionality to update their email address will be stuck in a 'boot loop' when clicking into the profile area due to their candidate document not being updated but their auth email being updated by the background function.
To Reproduce Steps to reproduce the behavior:
Expected behavior update does not cause bootloop Need to check if candidate's email already exists.
Additional context It has been highlighted that the background function exposed here is also used by the admin frontend, and that there is no auth to ensure that the user requesting the change is the same user who owns the candidate account.
Suggested fix (and improvement)
The following outline provides the key tasks in both fixing this bug and improving our solution to be simpler and more secure
Apply
updateEmailAddress
In the following places include a hint so the user knows they are changing their login email:
Whenever the email address is changed
candidate
documentapplication
documentAdmin
candidate
documentDigital-Platform
updateEmailAddress
onCandidatePersonalDetailsUpdate
background function to also check for email address changes: