Commit Graph
109 Commits
Author SHA1 Message Date
Matt Jankowski 3b1705a406 Add TermsOfService#usable_effective_date to DRY up view logic (#38095) 2026-03-09 09:38:00 +00:00
Matt Jankowski 6d9c16e4a1 Fix incorrect I18n string in webauthn mailers (#38062) 2026-03-05 10:37:12 +00:00
Matt Jankowski e7cec161fd Reduce haml-lint LineLength configuration to 240 (#37287) 2026-03-02 14:43:57 +00:00
Matt Jankowski 786891c333 Remove unused local vars from user mailer warning (#35977) 2025-09-02 07:35:53 +00:00
Claire e557769a3c Remove broken link to /start/share in welcome e-mail (#34962) 2025-06-08 13:58:53 +00:00
Claire 5a100bf38f Add ability to email announcements to all users (#33928) 2025-03-06 14:05:27 +00:00
Eugen Rochko cadda2f957 Add effective date to terms of service (#33993) 2025-03-05 09:01:33 +00:00
Matt Jankowski b0634b2943 Add helpers for ios/android app store links in welcome mailer (#33475) 2025-01-06 19:59:11 +00:00
Eugen Rochko 30aa0df88c Add terms of service (#33055) 2024-12-09 10:04:46 +00:00
Matt Jankowski 6f5eb22135 Mailer header partial access cleanup (#32585) 2024-10-28 13:41:56 +00:00
Matt Jankowski bd6c96f737 Fix broken i18n in text welcome mailer tags area (#32571) 2024-10-18 07:19:37 +00:00
Christian Schmidt 9d664f87a0 Mailer layout fixes (#32132) 2024-09-27 19:41:41 +00:00
Matt Jankowski 601834d746 Use partial collection render for welcome mailer features (#29843) 2024-04-04 16:13:10 +00:00
Matt Jankowski cde3206478 Simplify feature loop in welcome mailer (#29760) 2024-04-03 20:10:59 +00:00
Matt Jankowski e85f24174e Simplify checklist step loop in welcome mailer (#29761) 2024-03-28 10:56:33 +00:00
Matt Jankowski c4feba4347 Use existing MascotHelper#instance_presenter instead of local var in welcome email template (#29759) 2024-03-26 15:58:48 +00:00
Claire 82c2af0356 Fix user_mailer.welcome.hashtags_recent_count not having plural form (#29607) 2024-03-16 16:38:20 +00:00
HTeuMeuLeuandEugen Rochko 934cab7508 New welcome email (#28883)
Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
2024-03-01 12:16:53 +00:00
Eugen Rochko 1666b19559 Fix confirmation e-mails when signing up through an app (#29064) 2024-02-02 15:51:26 +00:00
Claire e2d9635074 Add notification email on invalid second authenticator (#28822) 2024-01-22 13:55:43 +00:00
Renaud Chaput cb5ac15923 Use a helper to avoid using media/ asset prefixes (#28756) 2024-01-17 12:19:51 +00:00
HTeuMeuLeuandMatt Jankowski 7f471e70c0 Update new email templates (#28416)
Co-authored-by: Matt Jankowski <matt@jankowski.online>
2024-01-15 18:18:59 +00:00
Matt Jankowski 6daa69327b Fix LineLength haml-lint in t usage (#28686) 2024-01-11 09:32:32 +00:00
Matt Jankowski c926f5fd67 Fix haml-lint UnnecessaryStringOutput for views (#27531) 2023-10-25 12:01:00 +00:00
Matt Jankowski e715da6d25 Fix haml-lint Rubocop Rails/* cops (#26042) 2023-10-03 15:00:40 +02:00
Claire 475783d567 Add timezone to datetimes in e-mails (#26822) 2023-09-06 17:25:39 +02:00
Claire c667fc5a4a Fix ArgumentError in mailers when a user's timezone is blank (#26025) 2023-07-17 12:10:50 +02:00
Eugen Rochko 4c9406bdb0 Add time zone preference (#25342) 2023-06-10 03:29:37 +02:00
Eugen Rochko 75e5a6e437 Change user backups to use expiring URLs for download when possible (#24136) 2023-03-16 22:46:52 +01:00
Nick Schonning 65669d3c57 Fix more haml-lint Rubocop (#24107) 2023-03-15 20:07:43 +01:00
Matt Jankowski 7f4412eeeb User mailer spec coverage improvements (#23905) 2023-03-04 17:16:11 +01:00
Eugen Rochko 5fd46dddd7 Remove unnecessary sections from welcome e-mail (#19299) 2022-10-06 00:03:52 +02:00
Eugen Rochko 36f4c32a38 Change path of privacy policy page (#19249) 2022-09-29 06:22:12 +02:00
Eugen Rochko 45aa5781ce Change brand color and logotypes (#18592)
- Add rake task for generating Apple/Android icons and favicons from SVG
- Add rake task for generating PNG icons and logos for e-mails from SVG
- Remove obsolete Microsoft icons and configuration
- Remove PWA shortcut icons
2022-06-09 22:25:23 +02:00
Eugen Rochko 6221b36b27 Remove sign-in token authentication, instead send e-mail about new sign-in (#17970) 2022-04-06 20:58:12 +02:00
Eugen Rochko cefa526c6d Refactor formatter (#17828)
* Refactor formatter

* Move custom emoji pre-rendering logic to view helpers

* Move more methods out of Formatter

* Fix code style issues

* Remove Formatter

* Add inline poll options to RSS feeds

* Remove unused helper method

* Fix code style issues

* Various fixes and improvements

* Fix test
2022-03-26 02:53:34 +01:00
Claire 3bc0aeed50 Change text version of warning mail to mention appeals instead of mails (#17725)
Also, the instruction to reply to e-mail would probably not work in many cases
where the notifications e-mail address is not able to receive incoming emails
or the mailbox is not actively monitored.
2022-03-09 12:11:11 +01:00
Eugen Rochko 564efd0651 Add appeals (#17364)
* Add appeals

* Add ability to reject appeals and ability to browse pending appeals in admin UI

* Add strikes to account page in settings

* Various fixes and improvements

- Add separate notification setting for appeals, separate from reports
- Fix style of links in report/strike header
- Change approving an appeal to not restore statuses (due to federation complexities)
- Change style of successfully appealed strikes on account settings page
- Change account settings page to only show unappealed or recently appealed strikes

* Change appealed_at to overruled_at

* Fix missing method error
2022-02-14 21:27:53 +01:00
Eugen Rochko 14f436c457 Add notifications for statuses deleted by moderators (#17204) 2022-01-17 09:41:33 +01:00
Eugen Rochko 480d7c9478 Fix missing source strings and inconsistent lead text style in admin UI (#16052) 2021-04-17 11:12:49 +02:00
santiagorodriguez96andFacundo Padula e8d41bc2fe Add WebAuthn as an alternative 2FA method (#14466)
* feat: add possibility of adding WebAuthn security keys to use as 2FA

This adds a basic UI for enabling WebAuthn 2FA. We did a little refactor
to the Settings page for editing the 2FA methods – now it will list the
methods that are available to the user (TOTP and WebAuthn) and from
there they'll be able to add or remove any of them.
Also, it's worth mentioning that for enabling WebAuthn it's required to
have TOTP enabled, so the first time that you go to the 2FA Settings
page, you'll be asked to set it up.
This work was inspired by the one donde by Github in their platform, and
despite it could be approached in different ways, we decided to go with
this one given that we feel that this gives a great UX.

Co-authored-by: Facundo Padula <facundo.padula@cedarcode.com>

* feat: add request for WebAuthn as second factor at login if enabled

This commits adds the feature for using WebAuthn as a second factor for
login when enabled.
If users have WebAuthn enabled, now a page requesting for the use of a
WebAuthn credential for log in will appear, although a link redirecting
to the old page for logging in using a two-factor code will also be
present.

Co-authored-by: Facundo Padula <facundo.padula@cedarcode.com>

* feat: add possibility of deleting WebAuthn Credentials

Co-authored-by: Facundo Padula <facundo.padula@cedarcode.com>

* feat: disable WebAuthn when an Admin disables 2FA for a user

Co-authored-by: Facundo Padula <facundo.padula@cedarcode.com>

* feat: remove ability to disable TOTP leaving only WebAuthn as 2FA

Following examples form other platforms like Github, we decided to make
Webauthn 2FA secondary to 2FA with TOTP, so that we removed the
possibility of removing TOTP authentication only, leaving users with
just WEbAuthn as 2FA. Instead, users will have to click on 'Disable 2FA'
in order to remove second factor auth.
The reason for WebAuthn being secondary to TOPT is that in that way,
users will still be able to log in using their code from their phone's
application if they don't have their security keys with them – or maybe
even lost them.

* We had to change a little the flow for setting up TOTP, given that now
  it's possible to setting up again if you already had TOTP, in order to
  let users modify their authenticator app – given that now it's not
  possible for them to disable TOTP and set it up again with another
  authenticator app.
  So, basically, now instead of storing the new `otp_secret` in the
  user, we store it in the session until the process of set up is
  finished.
  This was because, as it was before, when users clicked on 'Edit' in
  the new two-factor methods lists page, but then went back without
  finishing the flow, their `otp_secret` had been changed therefore
  invalidating their previous authenticator app, making them unable to
  log in again using TOTP.

Co-authored-by: Facundo Padula <facundo.padula@cedarcode.com>

* refactor: fix eslint errors

The PR build was failing given that linting returning some errors.
This commit attempts to fix them.

* refactor: normalize i18n translations

The build was failing given that i18n translations files were not
normalized.
This commits fixes that.

* refactor: avoid having the webauthn gem locked to a specific version

* refactor: use symbols for routes without '/'

* refactor: avoid sending webauthn disabled email when 2FA is disabled

When an admins disable 2FA for users, we were sending two mails
to them, one notifying that 2FA was disabled and the other to notify
that WebAuthn was disabled.
As the second one is redundant since the first email includes it, we can
remove it and send just one email to users.

* refactor: avoid creating new env variable for webauthn_origin config

* refactor: improve flash error messages for webauthn pages

Co-authored-by: Facundo Padula <facundo.padula@cedarcode.com>
2020-08-24 16:46:27 +02:00
Eugen Rochko 72a7cfaa39 Add e-mail-based sign in challenge for users with disabled 2FA (#14013) 2020-06-09 10:23:06 +02:00
ThibG 5524258da9 Fix “Email changed” notification sometimes having wrong e-mail (#13475)
* Fix “Email changed” notification sometimes having wrong e-mail

Fixes #6778

The root of the issue is that `send_devise_notification` was called before
the changes were properly commited to the database, causing the mailer to
pick previous values if running too early.

Devise's documentation provides guidance on how to handle that[1][2], however,
I have found it to not be working, as the following happens, in that order:
- `send_devise_notification` is called for the `email_changed` notification.
  In that case, `changed?` is false and `saved_changes?` is true, so
  if we use the former, we have the same issue.
- the `after_commit` hook is called
- `send_devise_notification` is called for the `confirmation_instructions`
  notification.
  In that case, `changed?` is still false, and `saved_changes?` still true,
  so if we use the latter, that second notification email is simply not
  going to be sent (as we would be queuing the notification *after*
  executing the after_commit hook).

This is because it may be called from either an `after_update` or
`after_commit` hook, the difference not being a call to `save` but the
transaction actually being committed to the database. This may arguably
be a bug in Devise, or Devise's notification.

The proposed workaround is inspired by Devise's documentation but checks
whether a transaction is open to make the call whether to immediately
send the notification or defer it to the `after_commit` hook.

[1]: https://www.rubydoc.info/github/plataformatec/devise/Devise%2FModels%2FAuthenticatable:send_devise_notification
[2]: https://github.com/heartcombo/devise/blob/406915cb781e38255a30ad2a0609e33952b9ec50/lib/devise/models/authenticatable.rb#L133-L194

* Fix cases when sending notifications without changing the model

* Defer sending if and only if in transaction including current record
2020-04-15 16:13:44 +02:00
Eugen Rochko e1066cd431 Add password challenge to 2FA settings, e-mail notifications (#11878)
Fix #3961
2019-09-18 16:37:27 +02:00
Eugen Rochko 3a3b40e0c3 Fix nil error in warning e-mail template (#11812) 2019-09-12 01:51:01 +02:00
Eugen Rochko 92a6fa6c90 Fix error in user warning template (#11741) 2019-09-03 05:57:30 +02:00
Eugen Rochko 14996496a5 Fix error in warning e-mail template (#11698) 2019-08-30 01:34:59 +02:00
Eugen Rochko 73ca0bb925 Add option to include reported statuses in warning e-mail (#11639) 2019-08-23 22:37:23 +02:00
Yamagishi Kazutoshi 8347479f5d Bump webpacker from 3.5.5 to 4.0.2 (#10277)
Bumps [webpacker](https://github.com/rails/webpacker) from 3.5.5 to 4.0.2.
- [Release notes](https://github.com/rails/webpacker/releases)
- [Changelog](https://github.com/rails/webpacker/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rails/webpacker/compare/v3.5.5...v4.0.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
Co-authored-by: Yamagishi Kazutoshi <ykzts@desire.sh>
2019-03-15 15:05:31 +01:00
Eugen Rochko 51e154f5e8 Admission-based registrations mode (#10250)
Fix #6856
Fix #6951
2019-03-14 05:28:30 +01:00