diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/auth/BaseAccountAuthenticator.java b/service/src/main/java/org/whispersystems/textsecuregcm/auth/BaseAccountAuthenticator.java index 4eb4b3da9..67efcdf70 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/auth/BaseAccountAuthenticator.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/auth/BaseAccountAuthenticator.java @@ -82,8 +82,9 @@ public class BaseAccountAuthenticator { if (device.get().getAuthenticationCredentials().verify(basicCredentials.getPassword())) { succeeded = true; - account.get().setAuthenticatedDevice(device.get()); - return Optional.of(updateLastSeen(account.get(), device.get())); + final Account authenticatedAccount = updateLastSeen(account.get(), device.get()); + authenticatedAccount.setAuthenticatedDevice(device.get()); + return Optional.of(authenticatedAccount); } return Optional.empty();