add auth-email header to auth request (#1414)

This commit is contained in:
Kyle Spearrin 2021-05-28 14:06:42 -04:00 committed by GitHub
parent fdda670311
commit 569045fcd5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View file

@ -1,6 +1,7 @@
using Bit.Core.Enums;
using System;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Text;
namespace Bit.Core.Models.Request
@ -78,5 +79,13 @@ namespace Bit.Core.Models.Request
}
return obj;
}
public void AlterIdentityTokenHeaders(HttpRequestHeaders headers)
{
if (MasterPasswordHash != null && Email != null)
{
headers.Add("Auth-Email", Email);
}
}
}
}

View file

@ -91,6 +91,7 @@ namespace Bit.Core.Services
Content = new FormUrlEncodedContent(request.ToIdentityToken(_platformUtilsService.IdentityClientId))
};
requestMessage.Headers.Add("Accept", "application/json");
request.AlterIdentityTokenHeaders(requestMessage.Headers);
HttpResponseMessage response;
try