Commit Graph

18 Commits

Author SHA1 Message Date
evazion
8f1d8e2c56 mailers: fix Rails 6.1 incompatibility.
`add_template_helper` is removed in Rails 6.1.
2020-12-13 04:10:48 -06:00
evazion
0ef9d6e417 emails: send welcome mail on signup. 2020-03-14 19:18:28 -05:00
evazion
d860fab7f5 emails: send verification mail when user changes address. 2020-03-14 18:32:00 -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
5625458f69 users: refactor password reset flow.
The old password reset flow:

* User requests a password reset.
* Danbooru generates a password reset nonce.
* Danbooru emails user a password reset confirmation link.
* User follows link to password reset confirmation page.
* The link contains a nonce authenticating the user.
* User confirms password reset.
* Danbooru resets user's password to a random string.
* Danbooru emails user their new password in plaintext.

The new password reset flow:

* User requests a password reset.
* Danbooru emails user a password reset link.
* User follows link to password edit page.
* The link contains a signed_user_id param authenticating the user.
* User changes their own password.
2020-03-08 23:18:15 -05:00
evazion
13528ac2d3 Drop forum subscriptions.
Few people used forum subscriptions (only around 100), and even fewer
people were subscribed to active threads. Most subscriptions were for
old threads that will never be bumped again. The implementation also had
a few problems:

* Unsubscribe links in emails didn't work (they unset the user's
  receive_email_notifications flag, but forum subscriptions didn't
  respect this flag).
* Some users had invalid email addresses, which caused notifications to
  bounce. There was no mechanism for preventing bounces.
* The implementation wasn't scalable. It involved a daily linear scan
  over _all_ forum subscriptions looking for any topics that had been updated.
2020-01-21 00:10:21 -06:00
evazion
efd1327f1e login: remove login reminder page.
Remove the login reminder page. The meaning of "login reminder" wasn't
clear (it's for recovering a forgotten username) and the functionality
was redundant. The password reset page can already be used to recover
forgotten usernames.

There was also a privacy leak, since the login reminder page could be
used to find out whether a given email is in use on Danbooru.
2019-12-14 16:19:01 -06:00
evazion
0c6d9f60bd Remove unused mailers. 2019-08-06 10:42:45 -05:00
r888888888
4c5e7a2708 fixes #2478: Add links for easy opt-out of emails 2015-09-03 17:03:03 -07:00
r888888888
2b96040a30 fixes #2191 2014-08-12 17:03:16 -07:00
小太
cba839ba76 Kill trailing whitespace in ruby files 2013-03-19 23:10:10 +11:00
albert
a6b76a9616 fix usermailer 2013-03-09 13:24:51 -05:00
albert
ed182f4cac fixes #703 2013-03-02 22:32:50 -05:00
albert
34b0c14550 fixes 2013-02-19 11:56:23 -05:00
albert
4baf5be7a2 added upgrade mailer 2011-12-02 16:46:37 -05:00
albert
60704c27be added from addr for user maint emails 2011-09-06 18:24:46 -04:00
albert
c453e7db0f implemented password resets 2011-07-20 15:54:17 -04:00
albert
72e9da01b5 fixing functional tests 2011-07-17 16:42:26 -04:00