diff --git a/libs/auth/src/common/services/auth-request/auth-request-api.service.ts b/libs/auth/src/common/services/auth-request/auth-request-api.service.ts index b5fc72588a6..c9fec1400c9 100644 --- a/libs/auth/src/common/services/auth-request/auth-request-api.service.ts +++ b/libs/auth/src/common/services/auth-request/auth-request-api.service.ts @@ -54,7 +54,20 @@ export class DefaultAuthRequestApiService implements AuthRequestApiService { async postAuthRequest(request: AuthRequest): Promise { 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) { diff --git a/libs/common/src/abstractions/api.service.ts b/libs/common/src/abstractions/api.service.ts index 5bd2221860b..fe3f356719b 100644 --- a/libs/common/src/abstractions/api.service.ts +++ b/libs/common/src/abstractions/api.service.ts @@ -142,7 +142,7 @@ export abstract class ApiService { body: any, authed: boolean, hasResponse: boolean, - apiUrl?: string, + apiUrl?: string | null, alterHeaders?: (headers: Headers) => void, ) => Promise; diff --git a/libs/common/src/services/api.service.ts b/libs/common/src/services/api.service.ts index ad59ad0837a..6d90f2ac253 100644 --- a/libs/common/src/services/api.service.ts +++ b/libs/common/src/services/api.service.ts @@ -1863,7 +1863,7 @@ export class ApiService implements ApiServiceAbstraction { body: any, authed: boolean, hasResponse: boolean, - apiUrl?: string, + apiUrl?: string | null, alterHeaders?: (headers: Headers) => void, ): Promise { const env = await firstValueFrom(this.environmentService.environment$);