-
Notifications
You must be signed in to change notification settings - Fork 5
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
Delete account route #331
base: master
Are you sure you want to change the base?
Delete account route #331
Conversation
Thanks for contributing! If you've made changes to the API's functionality, please make sure to bump the package version—see this guide to semantic versioning for details—and document those changes as appropriate. |
I agree, I think what FE can do is delete the bearer token after making this API call. The jwt package doesn't allow us to 'delete' or 'invalidate' a jwt token. A few things we should also discuss:
|
profilePicture: null, | ||
firstName: 'Deleted', | ||
lastName: 'User', | ||
graduationYear: 0, | ||
major: 'Deleted', | ||
points: 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: let's make the string values here all uppercased so that visually it's easier to distinguish deleted users and active users in e.g. a list of orders, a database table, etc.
lastLogin: new Date(0), | ||
bio: null, | ||
accessType: UserAccessType.RESTRICTED, | ||
state: UserState.BLOCKED, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re: my earlier comment about whether we should use a new DELETED
state if we plan on implementing separate BLOCKED
state functionality later. I think it makes more sense to have a DELETED
state because otherwise, a user could actually reach this state without even deleting their account (e.g. they fill "DELETED" as their first name, "USER" as last name, "DELETED" as major, their email as following the template above, and if they end up getting blocked by an admin that sets their access type and state to the above (again, only if the blocked functionality is implemented)). So I think it could be useful to have a state DELETED
with the only state transition to it being if a user actually specifies to delete their account.
Discussed offline that we'll be handing this off to someone else, let's put this on hold until the more urgent PRs are merged and new tasks are ready to be taken on |
Leaving as a draft PR for now - basic functionality seems to work to remove all sensitive data and update account state. Still want to discuss tests and edge cases later.
One peculiar thing is that a deleted account can continue to use their bearer token to make authenticated requests, however this would be a FE issue to clear the bearer token since re-logging in would no longer work.