add auth-email header (#394)

This commit is contained in:
Kyle Spearrin 2021-05-28 15:41:41 -04:00 committed by GitHub
parent 25a91313ad
commit ca61e13b57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -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);
}
}
}

View File

@ -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(),