mirror of
https://github.com/bitwarden/android.git
synced 2024-10-31 23:25:45 +03:00
add auth-email
header to auth request (#1414)
This commit is contained in:
parent
fdda670311
commit
569045fcd5
2 changed files with 10 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
using Bit.Core.Enums;
|
using Bit.Core.Enums;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http.Headers;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Bit.Core.Models.Request
|
namespace Bit.Core.Models.Request
|
||||||
|
@ -78,5 +79,13 @@ namespace Bit.Core.Models.Request
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void AlterIdentityTokenHeaders(HttpRequestHeaders headers)
|
||||||
|
{
|
||||||
|
if (MasterPasswordHash != null && Email != null)
|
||||||
|
{
|
||||||
|
headers.Add("Auth-Email", Email);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,6 +91,7 @@ namespace Bit.Core.Services
|
||||||
Content = new FormUrlEncodedContent(request.ToIdentityToken(_platformUtilsService.IdentityClientId))
|
Content = new FormUrlEncodedContent(request.ToIdentityToken(_platformUtilsService.IdentityClientId))
|
||||||
};
|
};
|
||||||
requestMessage.Headers.Add("Accept", "application/json");
|
requestMessage.Headers.Add("Accept", "application/json");
|
||||||
|
request.AlterIdentityTokenHeaders(requestMessage.Headers);
|
||||||
|
|
||||||
HttpResponseMessage response;
|
HttpResponseMessage response;
|
||||||
try
|
try
|
||||||
|
|
Loading…
Reference in a new issue