diff --git a/src/routes/console/project-[project]/auth/security/+page.svelte b/src/routes/console/project-[project]/auth/security/+page.svelte index 06271be0a..0d122b521 100644 --- a/src/routes/console/project-[project]/auth/security/+page.svelte +++ b/src/routes/console/project-[project]/auth/security/+page.svelte @@ -21,6 +21,7 @@ let period = writable('s'); let btnActive = false; let maxSessions = $project.authMaxSessions ?? 10; + let passwordHistory = $project.passwordHistory ?? 0; let options = [ { label: 'days', value: 'd' }, @@ -84,14 +85,18 @@ } async function updateSessionsLimit() { try { - const path = '/projects/' + projectId + '/auth/max-sessions'; const uri = new URL(sdkForConsole.client.config.endpoint + path); - await sdkForConsole.client.call('patch', uri, { - 'content-type': 'application/json', - }, { - limit: maxSessions - }); + await sdkForConsole.client.call( + 'patch', + uri, + { + 'content-type': 'application/json' + }, + { + limit: maxSessions + } + ); addNotification({ type: 'success', message: 'Sessions limit has been updated' @@ -104,6 +109,32 @@ }); } } + async function updatePasswordHistoryLimit() { + try { + const path = '/projects/' + projectId + '/auth/password-history'; + const uri = new URL(sdkForConsole.client.config.endpoint + path); + await sdkForConsole.client.call( + 'patch', + uri, + { + 'content-type': 'application/json' + }, + { + limit: passwordHistory + } + ); + addNotification({ + type: 'success', + message: 'Password history limit has been updated' + }); + trackEvent('submit_password_history_limit_update'); + } catch (error) { + addNotification({ + type: 'error', + message: error.message + }); + } + } period.subscribe((p) => { if (p === 'd') { @@ -225,18 +256,36 @@
+ +