Commit Graph

27 Commits

Author SHA1 Message Date
evazion
b551e3634f Fix misc rubocop warnings. 2020-06-16 21:36:15 -05:00
evazion
8134e92457 user deletions: fix error when given incorrect password.
Use validations instead of raising an exception when the password is
incorrect so that the controller can display errors sensibly.

Also fix users being logged out even when the deletion attempt failed
due to an incorrect password.
2020-04-03 23:44:23 -05:00
evazion
53b761dfe9 user deletions: fix rename conflict logic.
Remove the 10-try limit when there's a name conflict during renaming. We
forgot to increment the loop counter so this did nothing. This wasn't
necessary anyway since the loop will always terminate eventually because
names have finite length.
2020-04-03 23:44:02 -05:00
evazion
52dd8385f8 Fix #4383: Save and display deleted usernames for mods+.
Name changes for deleted users are already visible to mods, so the only
thing we need to do here is to generate a name change before the user is
deleted.
2020-04-03 23:44:02 -05:00
evazion
b2cf765d6d users: refactor login and authentication logic.
* Make authentication methods into User instance methods instead of
  class methods.
* Fix API key authentication to use a secure string comparison. Fixes a
  hypothetical (unlikely to be exploitable) timing attack.
* Move login logic from SessionCreator to SessionLoader.
2020-03-25 18:48:43 -05:00
evazion
5faa323729 users: clean up password update logic.
Pull the password reauthentication logic out of the user model and put
it in the password update controller where it belongs.

This fixes an issue where when a new user was created the user model had
an incorrect password error set on it by `encrypt_password_on_update`.
It was trying to verify the old password even though we don't have one
when creating a new user. This error caused the user create action to
redirect back to the signup page because `respond_with` thought that
creating the user failed.
2020-03-24 17:25:35 -05:00
evazion
258f4a8b95 users: move emails to separate table.
* Move emails from users table to email_addresses table.
* Validate that addresses are formatted correctly and are unique across
  users. Existing invalid emails are grandfathered in.
* Add is_verified flag (the address has been confirmed by the user).
* Add is_deliverable flag (an undeliverable address is an address that bounces).
* Normalize addresses to prevent registering multiple accounts with the
  same email address (using tricks like Gmail's plus addressing).
2020-03-12 21:18:53 -05:00
evazion
153a8339ab Inherit errors from StandardError instead of Exception. 2020-01-11 19:07:28 -06:00
evazion
309821bf73 rubocop: fix various style issues. 2019-12-22 21:23:37 -06:00
evazion
364ecfe68f db: drop unused columns from users table.
Note that the password_hash column was replaced by bcrypt_password_hash
in 2013, but the old password_hash column was never dropped.
2019-11-16 19:34:30 -06:00
evazion
4e8b3d9310 jobs: migrate user deletions to ActiveJob. 2019-08-16 20:49:34 -05:00
BrokenEagle
3c45273694 Add category for mod actions 2018-01-13 20:55:52 -08:00
r888888888
e70c2a3085 remove references to tag subscriptions 2017-11-17 13:45:17 -08:00
r888888888
d48ed95191 favoritescontroller#destroy should work even if the post doesn't exist, remove from favorites on expunge (fixes #3222) 2017-07-19 13:39:24 -07:00
r888888888
97da8f8647 deprecate tag subscriptions with warnings 2017-04-14 16:00:20 -07:00
Albert Yi
4d698bf98b add modaction helper 2017-01-03 15:04:47 -08:00
r888888888
4b24a5cb7e update to rails 4.2.5.1, add debugging info for tracking slow queries 2016-02-23 16:34:33 -08:00
Toks
71cd5ce783 fixes #2114 2014-05-29 22:55:35 -04:00
r888888888
aede1c347a fixes for #1895 2013-07-26 14:59:52 -07:00
r888888888
711054c1f6 fix queueing of favorite deletion on user deletions 2013-06-21 11:14:36 -07:00
Toks
a628864aff fixes #1715 2013-06-06 18:06:02 -04:00
r888888888
3afa6da1b0 fixes #1715 2013-06-05 17:25:14 -07:00
r888888888
08b6766446 fix user deletions 2013-06-05 15:14:06 -07:00
r888888888
537be26690 when deleting users, make the favorites removal asynchronoous 2013-05-29 17:24:51 -07:00
r888888888
178035b8e2 fixes #1679 2013-05-29 16:39:43 -07:00
r888888888
25673465d5 fixes #1597, create mod action for user deletions 2013-05-24 14:25:27 -07:00
r888888888
0a9e2a39b0 add account deletion 2013-05-16 15:15:00 -07:00