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:
Jorge Montejo
2025-10-27 14:16:10 +01:00
committed by GitHub
parent 6bb1a9e083
commit 382481735a
15 changed files with 90 additions and 19 deletions
+4 -1
View File
@@ -4,7 +4,7 @@ import { IsEmail, IsNotEmpty, IsString, MinLength } from 'class-validator';
import { AuthApiKey, AuthSession, AuthSharedLink, AuthUser, UserAdmin } from 'src/database';
import { ImmichCookie, UserMetadataKey } from 'src/enum';
import { UserMetadataItem } from 'src/types';
import { Optional, PinCode, toEmail } from 'src/validation';
import { Optional, PinCode, toEmail, ValidateBoolean } from 'src/validation';
export type CookieResponse = {
isSecure: boolean;
@@ -83,6 +83,9 @@ export class ChangePasswordDto {
@MinLength(8)
@ApiProperty({ example: 'password' })
newPassword!: string;
@ValidateBoolean({ optional: true, default: false })
invalidateSessions?: boolean;
}
export class PinCodeSetupDto {