Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Commit

Permalink
add auth-email header (#394)
Browse files Browse the repository at this point in the history
  • Loading branch information
kspearrin committed May 28, 2021
1 parent 25a9131 commit ca61e13
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/models/request/tokenRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,10 @@ export class TokenRequest {

return obj;
}

alterIdentityTokenHeaders(headers: Headers) {
if (this.clientSecret == null && this.masterPasswordHash != null && this.email != null) {
headers.set('Auth-Email', this.email);
}
}
}
1 change: 1 addition & 0 deletions src/services/api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ export class ApiService implements ApiServiceAbstraction {
if (this.customUserAgent != null) {
headers.set('User-Agent', this.customUserAgent);
}
request.alterIdentityTokenHeaders(headers);
const response = await this.fetch(new Request(this.identityBaseUrl + '/connect/token', {
body: this.qsStringify(request.toIdentityToken(request.clientId ?? this.platformUtilsService.identityClientId)),
credentials: this.getCredentials(),
Expand Down

0 comments on commit ca61e13

Please sign in to comment.