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

Removing own profile #273

Closed
simison opened this issue May 29, 2015 · 8 comments
Closed

Removing own profile #273

simison opened this issue May 29, 2015 · 8 comments
Assignees
Milestone

Comments

@simison
Copy link
Contributor

simison commented May 29, 2015

A feature for users to remove their own profile.

UI at the account page is already there, just backend missing.

Before removal:

  • Generate a token with our secret, user ID and timestamp, that we can decrypt (think JWT).
  • Send confirmation mail with token-URL in it
  • To access this URL you have to be logged in?
  • Token expires in 1h
  • Record two points to stats: 1) user removal initiated, 2) user removed. See how statService e.g. at auth controller.
  • Ask for feedback why user is leaving. Checkboxes. See the current form — questions could be different in the future. Send checkbox data to Stats servers.

Stuff to remove:

  • Profile
  • Profile photo if it's uploaded (it's always modules/users/img/profile/uploads/USER_ID/avatar/*.jpg) so just removing that folder will do.
  • Hosting offer
  • Mark all messages sent to that user as notified:true (so that unread-messages doesn't pick them up anymore). Leave messages from that user as is.
  • Contacts
  • -1 count for tribes user has joined
  • Sessions (not sure how easy/possible/important) Edit: old sessions get cleaned out anyway over time, but maybe remove logic could "hit" logout logic? Or maybe it doesn't matter.

Future development:

  • Send out an email to user after the profile removal.
  • Collect freetext feedback, could be sent to our support mail.
  • Prevent any user to sign up with that username afterwards? Leaving user object there would work for this, or some special reserved usernames table.
  • Security: https://github.com/expressjs/csurf — would be great to have this, but JWT style tokens should be secure enough.

All this said, feel free to implement this in some other quicker/better/easier way! This is just what we brainstormed so far.

@simison simison added this to the soonish milestone May 29, 2015
@simison simison mentioned this issue May 29, 2015
5 tasks
@simison simison removed the easy label May 29, 2015
@guaka guaka added the 1 - ready label Aug 7, 2015
@guaka
Copy link
Contributor

guaka commented Aug 7, 2015

@guaka guaka closed this as completed Aug 7, 2015
@guaka guaka removed the 1 - ready label Aug 7, 2015
@guaka
Copy link
Contributor

guaka commented Aug 7, 2015

#288 "profile deletion: find out why"

@mrkvon
Copy link
Contributor

mrkvon commented Jul 16, 2017

Thoughts:

  • Why email confirmation? Isn't it enough to be logged in, send DELETE request to api, perhaps with a password provided?
  • Currently if i know someone's username & email and i post it to the https://ideas.trustroots.org/account-removal/, will you distinguish between me and the real user?

@simison
Copy link
Contributor Author

simison commented Jul 16, 2017

Why email confirmation? Isn't it enough to be logged in, send DELETE request to api, perhaps with a password provided?

You're right. I'm just protecting my back security-wise especially because we don't have CSRF implemented. :-)

@simison
Copy link
Contributor Author

simison commented Jul 16, 2017

@mrkvon Feel free to change it tho! 👍

@mrkvon
Copy link
Contributor

mrkvon commented Jul 16, 2017

Well, that's a very valid point. Especially with the sensitive action of that kind.

https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet

@simison
Copy link
Contributor Author

simison commented Jul 16, 2017

Might be copying CSRF implementation from meanjs would've been faster than doing that email thingy tho! :-D But I mostly just copypasted it from forgot-password controller so not a biggie.

https://github.com/meanjs/mean/search?utf8=%E2%9C%93&q=CSRF&type=

@simison
Copy link
Contributor Author

simison commented Jul 16, 2017

Currently if i know someone's username & email and i post it to the https://ideas.trustroots.org/account-removal/, will you distinguish between me and the real user?

Yep, we ask for an email reply to confirm. Still not extremely secure but better than nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants