1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 13:23:34 +00:00

feat(feature-flags): Add Device-Identifier header to unauthenticated requests

* Added header to unauthenticated requests

* Added comment
This commit is contained in:
Todd Martin
2025-06-26 07:27:50 -04:00
committed by GitHub
parent 7d2b97b1df
commit 473ab3a1f7

View File

@@ -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) {