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:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user