diff --git a/apps/cm/package.json b/apps/cm/package.json index 64eb7edb4..1f9f98815 100644 --- a/apps/cm/package.json +++ b/apps/cm/package.json @@ -12,7 +12,7 @@ "@common/assets": "workspace:*", "@common/auth": "workspace:*", "@common/components": "workspace:*", - "@common/config": "workspace:*", + "@common/network": "workspace:*", "@dnd-kit/core": "^6.3.1", "@dnd-kit/sortable": "^10.0.0", "@dnd-kit/utilities": "^3.2.2", diff --git a/apps/cm/src/entities/auth/api/auth-service.ts b/apps/cm/src/entities/auth/api/auth-service.ts index ddb3dffac..721007103 100644 --- a/apps/cm/src/entities/auth/api/auth-service.ts +++ b/apps/cm/src/entities/auth/api/auth-service.ts @@ -16,7 +16,7 @@ import { setupRefreshTimer, tokenManager, } from "../lib/token-manager"; -import { clearDeviceId } from "../lib/device-id"; +import { clearDeviceId, getOrCreateDeviceId } from "../lib/device-id"; function resolveLoginError(message: string | undefined): string { switch (message) { @@ -46,7 +46,10 @@ function completeSession(accessToken: string, tokenId: string): void { async function login(payload: AuthPayload): Promise { const response = await fetch(`/api/proxy${ENDPOINT.USER_SERVICE.LOGIN}`, { method: "POST", - headers: { "Content-Type": "application/json" }, + headers: { + "Content-Type": "application/json", + "X-Device-Id": getOrCreateDeviceId(), + }, body: JSON.stringify(payload), }); @@ -71,7 +74,12 @@ async function silentRefresh(): Promise { try { const response = await fetch( `/api/proxy${ENDPOINT.USER_SERVICE.SILENT_REFRESH}`, - { method: "PUT" }, + { + method: "PUT", + headers: { + "X-Device-Id": getOrCreateDeviceId(), + }, + }, ); const data = await response.json(); diff --git a/apps/cm/tsconfig.json b/apps/cm/tsconfig.json index 5b8c29899..05cbfce70 100644 --- a/apps/cm/tsconfig.json +++ b/apps/cm/tsconfig.json @@ -22,12 +22,8 @@ "name": "next" } ], - "baseUrl": "./src", "paths": { - "@/*": ["./*"], - "@common/components": ["../../../packages/common/components/src/"], - "@common/config": ["../../../packages/common/config/dist/"], - "@common/network": ["../../../packages/common/network/"] + "@/*": ["./src/*"] } }, "include": [