Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I should be able to change my email without losing access to my data #140

Open
sylvansson opened this issue Mar 27, 2021 · 1 comment
Open
Assignees
Labels

Comments

@sylvansson
Copy link
Collaborator

The schemas for communicators and boards currently use the email field to identify the owner. This is problematic because a user loses access to their communicators and boards if they change their email address. A simple solution would be to update the documents when needed, but it would be preferable to use a stable identifier like the user id.

Suggested approach

  • Add a userId field to the Communicator and Board schemas. Migrate existing documents.
  • Update the listCommunicators and listBoards routes to only return the caller's communicators and boards. The user id should be taken from the token rather than passed explicitly by the caller. The frontend would need to be updated to use these routes instead of the /byemail versions.
  • Update the getCommunicatorsEmail and getBoardsEmail routes to return a 403 if a non-admin user sends the wrong email address. There would be no restriction for admins. Ideally we would only let admins call the routes, but we need to do this so that users with an older version of the app don't have to update.

@martinbedouret Does this make sense?

@martinbedouret
Copy link
Collaborator

@sylvansson This makes total sense to me. I would say we should block email address update from the frontend until this is done.

@sylvansson sylvansson self-assigned this Mar 30, 2021
sylvansson added a commit that referenced this issue Apr 29, 2021
sylvansson added a commit that referenced this issue Apr 29, 2021
sylvansson added a commit that referenced this issue Apr 29, 2021
sylvansson added a commit that referenced this issue Apr 29, 2021
* #140 Only allow admins to get another user's communicators

* #140 Only allow admins to get another user's boards
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants