File tree Expand file tree Collapse file tree
src/routes/(console)/project-[region]-[project]/auth/security Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4343 });
4444
4545 const hasChanges = $derived .by (() => {
46- const dictChanged = passwordDictionary !== project .authPasswordDictionary ;
47- const dataCheckChanged = authPersonalDataCheck !== project .authPersonalDataCheck ;
48- const historyChanged = passwordHistoryEnabled !== (project .authPasswordHistory !== 0 );
49-
50- return historyChanged || dictChanged || dataCheckChanged ;
46+ const dictChanged = passwordDictionary !== (project .authPasswordDictionary ?? false );
47+ const dataCheckChanged = authPersonalDataCheck !== (project .authPersonalDataCheck ?? false );
48+ const historyChanged =
49+ passwordHistoryEnabled !== ((project .authPasswordHistory ?? 0 ) !== 0 );
50+ const limitChanged =
51+ passwordHistoryEnabled &&
52+ Number (passwordHistory ) !== (project .authPasswordHistory ?? 0 );
53+
54+ return historyChanged || dictChanged || dataCheckChanged || limitChanged ;
5155 });
5256
5357 async function updatePasswordPolicies() {
Original file line number Diff line number Diff line change 88 import { sdk } from ' $lib/stores/sdk' ;
99 import { Typography } from ' @appwrite.io/pink-svelte' ;
1010 import type { Models } from ' @appwrite.io/console' ;
11+ import { onMount } from ' svelte' ;
1112
1213 let { project }: { project: Models .Project } = $props ();
1314
1415 let authSessionAlerts = $state (false );
1516 let sessionInvalidation = $state (false );
1617
17- // Initialize state from project
18- $effect (() => {
18+ onMount (() => {
1919 authSessionAlerts = project ?.authSessionAlerts ?? false ;
2020 sessionInvalidation = project ?.authInvalidateSessions ?? false ;
2121 });
2222
23- const hasChanges = $derived (
24- authSessionAlerts !== (project ?.authSessionAlerts ?? false ) ||
25- sessionInvalidation !== (project ?.authInvalidateSessions ?? false )
26- );
23+ const hasChanges = $derived .by (() => {
24+ const alertsChanged = authSessionAlerts !== (project ?.authSessionAlerts ?? false );
25+ const invalidationChanged =
26+ sessionInvalidation !== (project ?.authInvalidateSessions ?? false );
27+ return alertsChanged || invalidationChanged ;
28+ });
2729
2830 async function updateSessionSecurity() {
2931 try {
You can’t perform that action at this time.
0 commit comments