From 8d75905b24ea77db217a716d3bc85dc4bb0639f2 Mon Sep 17 00:00:00 2001
From: Harsh Mahajan <127186841+HarshMN2345@users.noreply.github.com>
Date: Fri, 2 Jan 2026 12:17:20 +0530
Subject: [PATCH] preserve password limit
---
.../auth/security/+page.svelte | 8 +++++---
.../auth/security/passwordPolicies.svelte | 13 ++++++++++++-
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/src/routes/(console)/project-[region]-[project]/auth/security/+page.svelte b/src/routes/(console)/project-[region]-[project]/auth/security/+page.svelte
index 6c0ce4359..385cfe1f5 100644
--- a/src/routes/(console)/project-[region]-[project]/auth/security/+page.svelte
+++ b/src/routes/(console)/project-[region]-[project]/auth/security/+page.svelte
@@ -1,6 +1,6 @@
-
-
+
+
diff --git a/src/routes/(console)/project-[region]-[project]/auth/security/passwordPolicies.svelte b/src/routes/(console)/project-[region]-[project]/auth/security/passwordPolicies.svelte
index d57c73842..46547cecb 100644
--- a/src/routes/(console)/project-[region]-[project]/auth/security/passwordPolicies.svelte
+++ b/src/routes/(console)/project-[region]-[project]/auth/security/passwordPolicies.svelte
@@ -16,18 +16,29 @@
let passwordHistoryEnabled = $state(false);
let passwordDictionary = $state(false);
let authPersonalDataCheck = $state(false);
+ let lastValidLimit = $state(5);
let maxPasswordInputField: InputNumber | null = null;
// Initialize and sync state when project updates
$effect(() => {
const historyValue = project?.authPasswordHistory;
- passwordHistory = historyValue < 1 ? 5 : historyValue;
+ if (historyValue && historyValue > 0) {
+ passwordHistory = historyValue;
+ lastValidLimit = historyValue;
+ }
passwordHistoryEnabled = (historyValue ?? 0) !== 0;
passwordDictionary = project?.authPasswordDictionary ?? false;
authPersonalDataCheck = project?.authPersonalDataCheck ?? false;
});
+ // restore last valid limit when enabling
+ $effect(() => {
+ if (passwordHistoryEnabled && passwordHistory < 1) {
+ passwordHistory = lastValidLimit;
+ }
+ });
+
$effect(() => {
if (passwordHistoryEnabled) {
tick().then(() => {