1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-05 23:53:33 +00:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Todd Martin
3e9d3787d8 Removed check for OS type before setting current push token on state. 2022-11-13 10:42:18 -05:00
Todd Martin
5b53c0c48f Added code to update PushToken that is used on login.
(cherry picked from commit 264b6791372b6a5d6c8c4f9e3c7e393b3ec4392b)
2022-11-13 10:27:29 -05:00
3 changed files with 6 additions and 6 deletions

View File

@@ -187,10 +187,8 @@ namespace Bit.App.Services
Debug.WriteLine($"{TAG} Registered device with server.");
await _stateService.Value.SetPushLastRegistrationDateAsync(DateTime.UtcNow);
if (deviceType == Device.Android)
{
await _stateService.Value.SetPushCurrentTokenAsync(token);
}
await _stateService.Value.SetPushCurrentTokenAsync(token);
}
#if DEBUG
catch (ApiException apiEx)

View File

@@ -5,10 +5,11 @@ namespace Bit.Core.Models.Request
{
public class DeviceRequest
{
public DeviceRequest(string appId, IPlatformUtilsService platformUtilsService)
public DeviceRequest(string appId, string pushToken, IPlatformUtilsService platformUtilsService)
{
Type = platformUtilsService.GetDevice();
Name = platformUtilsService.GetDeviceString();
PushToken = pushToken;
Identifier = appId;
}

View File

@@ -300,7 +300,8 @@ namespace Bit.Core.Services
{
var storedTwoFactorToken = await _tokenService.GetTwoFactorTokenAsync(email);
var appId = await _appIdService.GetAppIdAsync();
var deviceRequest = new DeviceRequest(appId, _platformUtilsService);
var pushToken = await _stateService.GetPushCurrentTokenAsync();
var deviceRequest = new DeviceRequest(appId, pushToken, _platformUtilsService);
string[] emailPassword;
string[] codeCodeVerifier;