Content Security Policy (CSP) Improvements.
This commit is contained in:
@@ -29,36 +29,6 @@ $loginAttempts = checkLoginAttempts();
|
||||
<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>
|
||||
@@ -105,7 +75,7 @@ $loginAttempts = checkLoginAttempts();
|
||||
<div class="card col-md-5 text-white bg-transparent py-0 border-0">
|
||||
<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>
|
||||
|
||||
@@ -139,7 +139,7 @@ if ($loginAttemptCount = checkLoginAttempts() > 3) {
|
||||
<div class="card col-md-5 text-white bg-transparent py-5 border-0">
|
||||
<div class="card-body text-center pt-3">
|
||||
<div>
|
||||
<img class="pt-3 w-100 portal-image" alt="portal-image" width="500" height="265" style="height: auto;" src="">
|
||||
<img class="pt-3 w-100 portal-image" alt="portal-image" width="500" height="265" src="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
36
pub/login/js/checkPasswords.js
Normal file
36
pub/login/js/checkPasswords.js
Normal file
@@ -0,0 +1,36 @@
|
||||
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);
|
||||
@@ -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>
|
||||
|
||||
@@ -98,7 +98,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>
|
||||
|
||||
Reference in New Issue
Block a user