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

[PM-18664] Prevent display of Auth Request notification on triggering device (#13597)

* Send device identifier in header.

* Added null to apiUrl property for strict typing.

* Added null to apiUrl for strict typing.
This commit is contained in:
Todd Martin
2025-02-27 10:00:52 -05:00
committed by GitHub
parent 182ff6481d
commit ec488e4f84
3 changed files with 16 additions and 3 deletions

View File

@@ -54,7 +54,20 @@ export class DefaultAuthRequestApiService implements AuthRequestApiService {
async postAuthRequest(request: AuthRequest): Promise<AuthRequestResponse> {
try {
const response = await this.apiService.send("POST", "/auth-requests/", request, false, true);
// Submit the current device identifier in the header as well as in the POST body.
// The value in the header will be used to build the request context and ensure that the resulting
// notifications have the current device as a source.
const response = await this.apiService.send(
"POST",
"/auth-requests/",
request,
false,
true,
null,
(headers) => {
headers.set("Device-Identifier", request.deviceIdentifier);
},
);
return new AuthRequestResponse(response);
} catch (e: unknown) {