diff --git a/i18n/en.json b/i18n/en.json index 935b188f..9154fb56 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -99,5 +99,6 @@ "oathauth-verify-enabled": "{{GENDER:$1|$1}} has two-factor authentication enabled.", "oathauth-verify-disabled": "{{GENDER:$1|$1}} does not have two-factor authentication enabled.", "oathauth-prefs-disabledgroups": "Disabled {{PLURAL:$1|group|groups}}:", - "oathauth-prefs-disabledgroups-help": "{{GENDER:$2|Your membership}} in {{PLURAL:$1|this group|these groups}} is disabled until you enable [[Special:Manage Two-factor authentication|two-factor authentication]]." + "oathauth-prefs-disabledgroups-help": "{{GENDER:$2|Your membership}} in {{PLURAL:$1|this group|these groups}} is disabled until you enable [[Special:Manage Two-factor authentication|two-factor authentication]].", + "oathauth-qrcode-alt": "Scannable QR code representing the secret key." } diff --git a/i18n/qqq.json b/i18n/qqq.json index 8517ccb1..fe49fb69 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -114,5 +114,6 @@ "oathauth-verify-enabled": "Notice that a user has 2FA enabled, shown on success at [[Special:VerifyOATHForUser]].\n$1 - Name of user", "oathauth-verify-disabled": "Notice that a user does not have 2FA enabled, shown on success at [[Special:VerifyOATHForUser]].\n$1 - Name of user", "oathauth-prefs-disabledgroups": "Label on Special:Preferences for groups in which the user's membership has been disabled for a lack of two-factor authentication.\n$1 - Number of groups", - "oathauth-prefs-disabledgroups-help": "Help message shown on Special:Preferences for the {{mw-msg|oathauth-prefs-disabledgroups}} field.\n$1 - Number of groups\n$2 - User name for GENDER" + "oathauth-prefs-disabledgroups-help": "Help message shown on Special:Preferences for the {{mw-msg|oathauth-prefs-disabledgroups}} field.\n$1 - Number of groups\n$2 - User name for GENDER", + "oathauth-qrcode-alt": "Accessibility label for the QR code image shown to users when enabling the TOTP on the [[Special:OATHManage]] page." } diff --git a/src/HTMLForm/TOTPEnableForm.php b/src/HTMLForm/TOTPEnableForm.php index ba842442..65b5536d 100644 --- a/src/HTMLForm/TOTPEnableForm.php +++ b/src/HTMLForm/TOTPEnableForm.php @@ -75,7 +75,12 @@ class TOTPEnableForm extends OATHAuthOOUIHTMLForm { ], 'qrcode' => [ 'type' => 'info', - 'default' => $qrCode->getString(), + 'default' => Html::element( 'img', [ + 'src' => $qrCode->getDataUri(), + 'alt' => $this->msg( 'oathauth-qrcode-alt' ), + 'width' => 256, + 'height' => 256, + ] ), 'raw' => true, 'section' => 'step2', ],