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

Add headers for client type and client version (#651)

This commit is contained in:
Oscar Hinton
2022-02-08 11:18:10 +01:00
committed by GitHub
parent 6b8508579f
commit 8130fce404
6 changed files with 35 additions and 10 deletions

View File

@@ -2,6 +2,7 @@ import { clipboard, ipcRenderer, shell } from "electron";
import { isDev, isMacAppStore } from "../utils";
import { ClientType } from "jslib-common/enums/clientType";
import { DeviceType } from "jslib-common/enums/deviceType";
import { ThemeType } from "jslib-common/enums/themeType";
@@ -11,8 +12,7 @@ import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.se
import { StateService } from "jslib-common/abstractions/state.service";
export class ElectronPlatformUtilsService implements PlatformUtilsService {
identityClientId: string;
private clientType: ClientType;
private deviceCache: DeviceType = null;
constructor(
@@ -21,7 +21,7 @@ export class ElectronPlatformUtilsService implements PlatformUtilsService {
private isDesktopApp: boolean,
private stateService: StateService
) {
this.identityClientId = isDesktopApp ? "desktop" : "connector";
this.clientType = isDesktopApp ? ClientType.Desktop : ClientType.DirectoryConnector;
}
getDevice(): DeviceType {
@@ -48,6 +48,10 @@ export class ElectronPlatformUtilsService implements PlatformUtilsService {
return device.replace("desktop", "");
}
getClientType() {
return this.clientType;
}
isFirefox(): boolean {
return false;
}