Rework secure_login_only configuration option to allow secure default and header checking

This commit is contained in:
Zankaria
2024-05-11 16:02:15 +02:00
parent 519dd27221
commit d700aa0522
4 changed files with 18 additions and 14 deletions

View File

@@ -35,7 +35,8 @@ function mod_login($redirect = false) {
$args = [];
if ($config['cookies']['secure_login_only'] && !Net\is_connection_secure()) {
$secure_login_mode = $config['cookies']['secure_login_only'];
if ($secure_login_mode !== 0 && !Net\is_connection_secure($secure_login_mode === 1)) {
$args['error'] = $config['error']['insecure'];
} elseif (isset($_POST['login'])) {
// Check if inputs are set and not empty