1
0
mirror of https://github.com/bitwarden/server.git synced 2024-12-25 17:27:45 +01:00

Set Id property on existing devices so we don't try to create a new one instead of updating existing. (#2420)

This commit is contained in:
Todd Martin 2022-11-18 10:22:07 -05:00 committed by GitHub
parent 3bece3c3ad
commit 02e4b10ae8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -562,6 +562,10 @@ public abstract class BaseRequestValidator<T> where T : class
} }
} }
} }
else
{
deviceFromRequest.Id = existingDevice.Id;
}
deviceFromRequest.UserId = user.Id; deviceFromRequest.UserId = user.Id;
await _deviceService.SaveAsync(deviceFromRequest); await _deviceService.SaveAsync(deviceFromRequest);