diff --git a/app/assets/javascripts/discourse/templates/preferences-second-factor.hbs b/app/assets/javascripts/discourse/templates/preferences-second-factor.hbs
index c425d6bf7f7..dcd1368fdd6 100644
--- a/app/assets/javascripts/discourse/templates/preferences-second-factor.hbs
+++ b/app/assets/javascripts/discourse/templates/preferences-second-factor.hbs
@@ -20,7 +20,7 @@
- {{second-factor-input value=secondFactorToken inputId='second-factor-token'}}
+ {{second-factor-input maxlength=6 value=secondFactorToken inputId='second-factor-token'}}
@@ -72,7 +72,7 @@
- {{second-factor-input value=secondFactorToken inputId='second-factor-token'}}
+ {{second-factor-input maxlength=6 value=secondFactorToken inputId='second-factor-token'}}