1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

[PM-26649] Prevent log-out when changing KDF settings (except old clients) (#16775)

* Prevent log-out when changing KDF settings (except old clients)

* test coverage

* logout reason enum
This commit is contained in:
Maciej Zieniuk
2025-10-21 11:26:48 +02:00
committed by GitHub
parent a15d6867f9
commit 20ddf3b6fd
6 changed files with 96 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
import { NotificationViewResponse as EndUserNotificationResponse } from "@bitwarden/common/vault/notifications/models";
import { NotificationType } from "../../enums";
import { NotificationType, PushNotificationLogOutReasonType } from "../../enums";
import { BaseResponse } from "./base.response";
@@ -41,9 +41,11 @@ export class NotificationResponse extends BaseResponse {
case NotificationType.SyncOrganizations:
case NotificationType.SyncOrgKeys:
case NotificationType.SyncSettings:
case NotificationType.LogOut:
this.payload = new UserNotification(payload);
break;
case NotificationType.LogOut:
this.payload = new LogOutNotification(payload);
break;
case NotificationType.SyncSendCreate:
case NotificationType.SyncSendUpdate:
case NotificationType.SyncSendDelete:
@@ -184,3 +186,14 @@ export class ProviderBankAccountVerifiedPushNotification extends BaseResponse {
this.adminId = this.getResponseProperty("AdminId");
}
}
export class LogOutNotification extends BaseResponse {
userId: string;
reason?: PushNotificationLogOutReasonType;
constructor(response: any) {
super(response);
this.userId = this.getResponseProperty("UserId");
this.reason = this.getResponseProperty("Reason");
}
}