Fix TOTP input field not being shown when enabled (#2783)

This commit is contained in:
DL6ER
2023-10-30 08:09:15 +01:00
committed by GitHub
+10 -4
View File
@@ -111,10 +111,16 @@ $(function () {
// Check if we need to login at all
$.ajax({
url: "/api/auth",
}).done(function (data) {
if (data.session.valid === true) redirect();
if (data.session.totp === true) $("#totp_input").removeClass("hidden");
});
})
.done(function (data) {
// If we are already logged in, redirect to dashboard
if (data.session.valid === true) redirect();
})
.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
$.ajax({