Skip to content

Commit b93570f

Browse files
committed
Unset twofa on error
+ Autofocus on fields
1 parent e4a118d commit b93570f

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

web/login/index.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ function authenticate_user(){
107107
unset($output);
108108
if ( $return_var > 0 ) {
109109
sleep(2);
110+
unset($_POST['twofa']);
110111
$error = "<a class=\"error\">".__('Invalid or missing 2FA token')."</a>";
111112
return $error;
112113
}
@@ -183,5 +184,7 @@ function authenticate_user(){
183184
require_once('../templates/login_1.html');
184185
}else if (empty($_POST['twofa'])) {
185186
require_once('../templates/login_2.html');
187+
} else {
188+
require_once('../templates/login.html');
186189
}
187190
?>

web/templates/login.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</tr>
2424
<tr>
2525
<td>
26-
<input tabindex="1" type="text" size="20px" style="width:240px;" name="user" class="vst-input">
26+
<input tabindex="1" type="text" size="20px" style="width:240px;" name="user" class="vst-input" autofocus />
2727
</td>
2828
</tr>
2929
<tr>

web/templates/login_1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
</tr>
3131
<tr>
3232
<td>
33-
<input tabindex="2" type="password" size="20px" style="width:240px;" name="password" class="vst-input">
33+
<input tabindex="2" type="password" size="20px" style="width:240px;" name="password" class="vst-input" autofocus />
3434
</td>
3535
</tr>
3636
<tr>

web/templates/login_2.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
</tr>
3131
<tr>
3232
<td>
33-
<input tabindex="2" type="" size="20px" style="width:240px;" name="twofa" class="vst-input">
33+
<input tabindex="2" type="" size="20px" style="width:240px;" name="twofa" class="vst-input" autofocus />
3434
</td>
3535
</tr>
3636
<tr>

0 commit comments

Comments
 (0)