From 473ab3a1f744a37aa46eb6b43e96bff7970527af Mon Sep 17 00:00:00 2001 From: Todd Martin <106564991+trmartin4@users.noreply.github.com> Date: Thu, 26 Jun 2025 07:27:50 -0400 Subject: [PATCH] feat(feature-flags): Add Device-Identifier header to unauthenticated requests * Added header to unauthenticated requests * Added comment --- libs/common/src/services/api.service.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/common/src/services/api.service.ts b/libs/common/src/services/api.service.ts index f9d308ba2a0..ca6cd6570a4 100644 --- a/libs/common/src/services/api.service.ts +++ b/libs/common/src/services/api.service.ts @@ -1813,6 +1813,11 @@ export class ApiService implements ApiServiceAbstraction { if (authed) { const authHeader = await this.getActiveBearerToken(); headers.set("Authorization", "Bearer " + authHeader); + } else { + // For unauthenticated requests, we need to tell the server what the device is for flag targeting, + // since it won't be able to get it from the access token. + const appId = await this.appIdService.getAppId(); + headers.set("Device-Identifier", appId); } if (body != null) {