mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat: logout sessions on password change (#23188)
* log out ohter sessions on password change * translations * update and add tests * rename event to UserLogoutOtherSessions * fix typo * requested changes * fix tests * fix medium:test * use ValidateBoolean * fix format * dont delete current session id * Update server/src/dtos/auth.dto.ts Co-authored-by: Daniel Dietzler <36593685+danieldietzler@users.noreply.github.com> * rename event and invalidateOtherSessions * chore: cleanup --------- Co-authored-by: Daniel Dietzler <36593685+danieldietzler@users.noreply.github.com> Co-authored-by: Jason Rasmussen <jason@rasm.me>
This commit is contained in:
parent
6bb1a9e083
commit
382481735a
15 changed files with 90 additions and 19 deletions
|
|
@ -4,6 +4,7 @@
|
|||
NotificationType,
|
||||
} from '$lib/components/shared-components/notification/notification';
|
||||
import SettingInputField from '$lib/components/shared-components/settings/setting-input-field.svelte';
|
||||
import SettingSwitch from '$lib/components/shared-components/settings/setting-switch.svelte';
|
||||
import { SettingInputFieldType } from '$lib/constants';
|
||||
import { changePassword } from '@immich/sdk';
|
||||
import { Button } from '@immich/ui';
|
||||
|
|
@ -14,10 +15,11 @@
|
|||
let password = $state('');
|
||||
let newPassword = $state('');
|
||||
let confirmPassword = $state('');
|
||||
let invalidateSessions = $state(false);
|
||||
|
||||
const handleChangePassword = async () => {
|
||||
try {
|
||||
await changePassword({ changePasswordDto: { password, newPassword } });
|
||||
await changePassword({ changePasswordDto: { password, newPassword, invalidateSessions } });
|
||||
|
||||
notificationController.show({
|
||||
message: $t('updated_password'),
|
||||
|
|
@ -69,6 +71,12 @@
|
|||
passwordAutocomplete="new-password"
|
||||
/>
|
||||
|
||||
<SettingSwitch
|
||||
title={$t('log_out_all_devices')}
|
||||
subtitle={$t('change_password_form_log_out_description')}
|
||||
bind:checked={invalidateSessions}
|
||||
/>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<Button
|
||||
shape="round"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue