Page MenuHomePhabricator

Add new notifications for additional 2FA being enabled/disabled
Open, Needs TriagePublic

Description

We currently have notifications for 2FA being enabled/disabled, but we should have distinct notifications for when 2FA is already enabled, and another 2FA method is enabled. Possibly telling the user how many different ones are enabled.

Similarly, when one is disabled (but there's still >1 enabled), show a notification to let the user know that a specific method has been disabled.

Following on the multi factor work, and similar to T404268: Warn users before they delete their last 2FA key; we should probably push the user a notification if they continue to disable the last 2FA, rather than just a popup during that workflow.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Reedy renamed this task from Add new notifications for additional 2FA to Add new notifications for additional 2FA being enabled/disabled.Dec 22 2023, 6:05 PM
Reedy moved this task from Backlog to External on the Notifications (Echo) board.

Change 985617 had a related patch set uploaded (by Majavah; author: Majavah):

[mediawiki/extensions/OATHAuth@master] notifications: Store number of keys in notification data

https://gerrit.wikimedia.org/r/985617

Change 985618 had a related patch set uploaded (by Majavah; author: Majavah):

[mediawiki/extensions/OATHAuth@master] notifications: Show number of remaining devices

https://gerrit.wikimedia.org/r/985618

Change 985617 merged by jenkins-bot:

[mediawiki/extensions/OATHAuth@master] notifications: Store number of keys in notification data

https://gerrit.wikimedia.org/r/985617

Change 985618 merged by jenkins-bot:

[mediawiki/extensions/OATHAuth@master] notifications: Show number of remaining devices

https://gerrit.wikimedia.org/r/985618

I think all that's left on this one is when an "extra" device has been setup, and improving the wording/display for those in a similar way to the disable ones have been done

taavi removed taavi as the assignee of this task.Apr 21 2025, 10:54 AM
taavi subscribed.
Mstyles subscribed.

The current notifications are a good start and it looks like the current code will support email notifications for more than one authenticator. We will probably want the email notifications to be a bit more detailed about what authentication methods were enabled/disabled and possibly other kinds of notifications too.

The current notifications are:

When 2FA is enabled (user creates their first 2FA key):

Two-factor authentication has been enabled on {{GENDER:$2|your account}}.
If {{GENDER:$2|you}} did not do this, {{GENDER:$2|your account}} may have been compromised.

When an additional 2FA key is added: no notification is currently sent

When the user removes their last 2FA method:

Two-factor authentication has been disabled on {{GENDER:$2|your account}}.
If {{GENDER:$2|you}} did not do this, {{GENDER:$2|your account}} may have been compromised.

When an admin removes the user's last 2FA method for them:

Two-factor authentication has been disabled on {{GENDER:$2|your account}}.
If {{GENDER:$2|you}} did not request this, {{GENDER:$2|you}} should contact an administrator.

When the user removes a 2FA method, but it's not the last one:

A two-factor authentication device has been removed from {{GENDER:$2|your account}}.
If {{GENDER:$2|you}} did not do this, {{GENDER:$2|your account}} may have been compromised. There still {{PLURAL:$3|is an additional device|are $3 additional devices}} active on {{GENDER:$2|your account}}.

When an admin does that for them:

A two-factor authentication device has been removed from {{GENDER:$2|your account}}.
If {{GENDER:$2|you}} did not request this, {{GENDER:$2|you}} should contact an administrator. There still {{PLURAL:$3|is an additional device|are $3 additional devices}} active on {{GENDER:$2|your account}}.