Skip to content

Commit

Permalink
Fix TOTP input field not being shown when enabled
Browse files Browse the repository at this point in the history
Signed-off-by: DL6ER <[email protected]>
  • Loading branch information
DL6ER committed Oct 24, 2023
1 parent 82f1965 commit 8683eeb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/pi-hole/js/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,12 @@ $(function () {
$.ajax({
url: "/api/auth",
}).done(function (data) {
// If we are already logged in, redirect to dashboard
if (data.session.valid === true) redirect();
if (data.session.totp === true) $("#totp_input").removeClass("hidden");
}).fail(function (xhr) {
const session = xhr.responseJSON.session;
// If TOPT is enabled, show the input field
if (session.totp === true) $("#totp_input").removeClass("hidden");
});

// Get information about HTTPS port and DNS status
Expand Down

0 comments on commit 8683eeb

Please sign in to comment.