Content Security Policy (CSP) Improvements.

This commit is contained in:
2026-06-20 22:52:21 +02:00
parent e96d6b9a70
commit 229d2b4a15
35 changed files with 167 additions and 354 deletions

View File

@@ -56,36 +56,6 @@ if (checkLoginAttempts() > 20) {
<link rel="apple-touch-icon" sizes="180x180" href="/src/images/favicon/apple-touch-icon.png">
<link rel="manifest" href="/src/images/favicon/site.webmanifest">
<style>
body {
font-family: Arial, sans-serif;
background-color: #1d222b;
}
.portal-image {
width: 100%;
height: auto;
aspect-ratio: 3 / 1;
object-fit: contain;
display: block;
min-height: 200px; /* Prevent layout shift during image load */
}
#code-container {
display: flex;
justify-content: center;
gap: 10px;
}
.code-input {
width: 40px;
height: 40px;
font-size: 24px;
text-align: center;
margin: 5px;
}
</style>
<link rel="stylesheet" href="css/style.full.css" as="style">
</head>
<body>
@@ -143,7 +113,7 @@ if (checkLoginAttempts() > 20) {
<div class="card col-md-5 text-white bg-transparent py-5">
<div class="card-body text-center pt-5">
<div>
<img class="pt-3 w-100 portal-image" alt="portal-image" src="" width="500" height="265" style="height: auto;">
<img class="pt-3 w-100 portal-image" alt="portal-image" src="" width="500" height="265">
</div>
</div>
</div>
@@ -153,43 +123,6 @@ if (checkLoginAttempts() > 20) {
</div>
</div>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
<script>
const password = document.getElementById("password");
const confirmPassword = document.getElementById("confirmPassword");
const submitBtn = document.getElementById("submitBtn");
const passwordHelp = document.getElementById("passwordHelp");
const passwordPolicyError = document.getElementById("passwordPolicyError");
function checkPasswords() {
const pwValue = password.value;
const confirmValue = confirmPassword.value;
// Check length
if (pwValue.length < 13) {
passwordPolicyError.classList.remove("d-none");
submitBtn.disabled = true;
return;
} else {
passwordPolicyError.classList.add("d-none");
}
// Check match
if (pwValue && confirmValue) {
if (pwValue === confirmValue) {
passwordHelp.classList.add("d-none");
submitBtn.disabled = false;
} else {
passwordHelp.classList.remove("d-none");
submitBtn.disabled = true;
}
} else {
passwordHelp.classList.add("d-none");
submitBtn.disabled = true;
}
}
password.addEventListener("input", checkPasswords);
confirmPassword.addEventListener("input", checkPasswords);
</script>
<script src="/login/js/checkPasswords.js"></script>
</body>
</html>