MFA: allow recovery codes only if two-factor auth is enabled

Fixes #965

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2022-08-31 09:29:39 +02:00
parent f0839519a8
commit 3267a50ae3
7 changed files with 205 additions and 65 deletions

View File

@@ -81,6 +81,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
</div>
</div>
{{if .TOTPConfig.Enabled }}
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">Recovery codes</h6>
@@ -117,6 +118,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
</div>
</div>
{{end}}
{{end}}
{{define "dialog"}}
<div class="modal fade" id="disableTOTPModal" tabindex="-1" role="dialog" aria-labelledby="disableTOTPModalLabel"
@@ -344,7 +346,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
$('#errorRecCodesMsg').show();
setTimeout(function () {
$('#errorRecCodesMsg').hide();
}, 5000);
}, 8000);
}
});
}
@@ -388,7 +390,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
$('#errorRecCodesMsg').show();
setTimeout(function () {
$('#errorRecCodesMsg').hide();
}, 5000);
}, 8000);
}
});
}