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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user