fix and update

This commit is contained in:
lendry
2026-07-02 00:10:22 +03:00
parent bcdfbc3861
commit 4306d0ce37
11 changed files with 375 additions and 41 deletions

View File

@@ -11,6 +11,7 @@ interface PublicSettingsContextValue {
publicFrontendUrl: string;
ldapEnabled: boolean;
ldapUseLdaps: boolean;
pinLockTimeoutMinutes: number;
isLoading: boolean;
refreshPublicSettings: () => Promise<void>;
}
@@ -22,6 +23,7 @@ const PublicSettingsContext = createContext<PublicSettingsContextValue>({
publicFrontendUrl: DEFAULT_PUBLIC_FRONTEND_URL,
ldapEnabled: false,
ldapUseLdaps: false,
pinLockTimeoutMinutes: 15,
isLoading: true,
refreshPublicSettings: async () => undefined
});
@@ -65,6 +67,7 @@ export function PublicSettingsProvider({ children }: { children: React.ReactNode
publicFrontendUrl: publicFrontendUrl.replace(/\/+$/, ''),
ldapEnabled: ['true', '1', 'yes'].includes((settings.LDAP_ENABLED ?? '').trim().toLowerCase()),
ldapUseLdaps: ['true', '1', 'yes'].includes((settings.LDAP_USE_LDAPS ?? '').trim().toLowerCase()),
pinLockTimeoutMinutes: Math.max(1, Number.parseInt(settings.PIN_LOCK_TIMEOUT_MINUTES ?? '15', 10) || 15),
isLoading,
refreshPublicSettings
};