jac-uk / digital-platform

Firebase/GCP configuration and components for our digital platform
MIT License
2 stars 1 forks source link

BUG: Candidate change own email broken #914

Open tomlovesgithub opened 11 months ago

tomlovesgithub commented 11 months ago

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:

  1. Go to 'profile'
  2. update your email address (automatically logs you out)
  3. log in again
  4. go to profile
  5. 'log out' modal pops up and prompts you to logout -> returns you to step 3

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

In the following places include a hint so the user knows they are changing their login email:

Whenever the email address is changed

Admin

Digital-Platform

nickaddy commented 9 months ago

Hey team! Please add your planning poker estimate with Zenhub @drieJAC @HalcyonJAC @tomlovesgithub @warrensearle

warrensearle commented 9 months ago

@tomlovesgithub and @warrensearle to refine ticket content

warrensearle commented 8 months ago

@tomlovesgithub and I have reviewed this ticket and progressed it to ready to play

warrensearle commented 5 months ago

@nickaddy, @tomlovesgithub and @warrensearle the improvements suggested in this ticket are still relevant:

However the ticket needs further re-writing as the original bug described is no longer a problem.