diff --git a/www/web/templates/two_factor/core/login.html b/www/web/templates/two_factor/core/login.html
index 86fc6220a98603ec3cbbbd8cc80e95b8bcc39959..b96c11ef41af7b44c7fc9981ead93c96c3337b45 100644
--- a/www/web/templates/two_factor/core/login.html
+++ b/www/web/templates/two_factor/core/login.html
@@ -54,4 +54,12 @@
 <a class="btn" href="/account/reset_password">{% trans "Forgot Password?" %}</a><br>
 <a class="btn" href="/account/registration/">{% trans "Register" %}</a><br>
 <a class="btn" href="/account/registration/resend">{% trans "Resend Activation Link" %}</a>
+<script>
+if(document.getElementById("id_auth-username").value) {
+    $("#id_auth-password").focus();
+} else {
+     $("#id_auth-username").focus();
+}
+
+</script>
 {% endblock %}
\ No newline at end of file