mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 22:03:36 +00:00
feat(feature-flags): Add Device-Identifier header to unauthenticated requests
* Added header to unauthenticated requests * Added comment
This commit is contained in:
@@ -1813,6 +1813,11 @@ export class ApiService implements ApiServiceAbstraction {
|
|||||||
if (authed) {
|
if (authed) {
|
||||||
const authHeader = await this.getActiveBearerToken();
|
const authHeader = await this.getActiveBearerToken();
|
||||||
headers.set("Authorization", "Bearer " + authHeader);
|
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) {
|
if (body != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user