Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14828830
D19722.id47121.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D19722.id47121.diff
View Options
diff --git a/src/applications/auth/factor/PhabricatorTOTPAuthFactor.php b/src/applications/auth/factor/PhabricatorTOTPAuthFactor.php
--- a/src/applications/auth/factor/PhabricatorTOTPAuthFactor.php
+++ b/src/applications/auth/factor/PhabricatorTOTPAuthFactor.php
@@ -154,6 +154,7 @@
id(new PHUIFormNumberControl())
->setName($this->getParameterName($config, 'totpcode'))
->setLabel(pht('App Code'))
+ ->setDisableAutocomplete(true)
->setCaption(pht('Factor Name: %s', $config->getFactorName()))
->setValue(idx($validation_result, 'value'))
->setError(idx($validation_result, 'error', true)));
diff --git a/src/view/form/control/PHUIFormNumberControl.php b/src/view/form/control/PHUIFormNumberControl.php
--- a/src/view/form/control/PHUIFormNumberControl.php
+++ b/src/view/form/control/PHUIFormNumberControl.php
@@ -2,11 +2,28 @@
final class PHUIFormNumberControl extends AphrontFormControl {
+ private $disableAutocomplete;
+
+ public function setDisableAutocomplete($disable_autocomplete) {
+ $this->disableAutocomplete = $disable_autocomplete;
+ return $this;
+ }
+
+ public function getDisableAutocomplete() {
+ return $this->disableAutocomplete;
+ }
+
protected function getCustomControlClass() {
return 'phui-form-number';
}
protected function renderInput() {
+ if ($this->getDisableAutocomplete()) {
+ $autocomplete = 'off';
+ } else {
+ $autocomplete = null;
+ }
+
return javelin_tag(
'input',
array(
@@ -15,6 +32,7 @@
'name' => $this->getName(),
'value' => $this->getValue(),
'disabled' => $this->getDisabled() ? 'disabled' : null,
+ 'autocomplete' => $autocomplete,
'id' => $this->getID(),
));
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 30, 2:06 PM (12 m, 48 s)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7074774
Default Alt Text
D19722.id47121.diff (1 KB)
Attached To
Mode
D19722: Add 'autocomplete="off"' to MFA TOTP inputs
Attached
Detach File
Event Timeline
Log In to Comment