mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
DEV: Show confirmation dialog when admins disable 2FA (#29652)
This PR ensures that admins are shown a confirmation dialog when clicking to disable 2FA for a user. The 2FA button is right below the "Grant Badge" button and as such it can easily be clicked accidentally. It's also good practice to ask for confirmation before removing important functionality.
This commit is contained in:
@ -374,7 +374,12 @@ export default class AdminUserIndexController extends Controller.extend(
|
||||
|
||||
@action
|
||||
disableSecondFactor() {
|
||||
return this.model.disableSecondFactor();
|
||||
this.dialog.yesNoConfirm({
|
||||
message: I18n.t("admin.user.disable_second_factor_confirm"),
|
||||
didConfirm: () => {
|
||||
return this.model.disableSecondFactor();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@action
|
||||
|
Reference in New Issue
Block a user