Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/App/Services/PushNotificationListenerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,8 @@ await _apiService.Value.PutDeviceTokenAsync(appId,
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)
Expand Down
3 changes: 2 additions & 1 deletion src/Core/Models/Request/DeviceRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
3 changes: 2 additions & 1 deletion src/Core/Services/AuthService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,8 @@ private async Task<AuthResult> LogInHelperAsync(string email, string hashedPassw
{
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;
Expand Down