1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-16 00:03:22 +00:00

HandleTokenStateAsync before each API call for refresh and auth bearer migration

This commit is contained in:
Kyle Spearrin
2017-02-04 23:31:37 -05:00
parent 8ae95c4e30
commit 74239521cd
11 changed files with 216 additions and 30 deletions

View File

@@ -13,8 +13,9 @@ namespace Bit.App.Repositories
{
public DeviceApiRepository(
IConnectivity connectivity,
IHttpService httpService)
: base(connectivity, httpService)
IHttpService httpService,
ITokenService tokenService)
: base(connectivity, httpService, tokenService)
{ }
protected override string ApiRoute => "devices";
@@ -26,6 +27,12 @@ namespace Bit.App.Repositories
return HandledNotConnected();
}
var tokenStateResponse = await HandleTokenStateAsync();
if(!tokenStateResponse.Succeeded)
{
return tokenStateResponse;
}
using(var client = HttpService.Client)
{
var requestMessage = new TokenHttpRequestMessage(request)