mirror of
https://github.com/bitwarden/server
synced 2026-01-03 00:53:37 +00:00
Fixed null reference to device when loggin in for website
This commit is contained in:
@@ -111,11 +111,14 @@ namespace Bit.Core.Identity
|
||||
success.Token = token;
|
||||
success.User = user;
|
||||
|
||||
var existingDevice = await _deviceRepository.GetByIdentifierAsync(device.Identifier, user.Id);
|
||||
if(existingDevice == null)
|
||||
if(device != null)
|
||||
{
|
||||
device.UserId = user.Id;
|
||||
await _deviceRepository.CreateAsync(device);
|
||||
var existingDevice = await _deviceRepository.GetByIdentifierAsync(device.Identifier, user.Id);
|
||||
if(existingDevice == null)
|
||||
{
|
||||
device.UserId = user.Id;
|
||||
await _deviceRepository.CreateAsync(device);
|
||||
}
|
||||
}
|
||||
|
||||
return success;
|
||||
|
||||
Reference in New Issue
Block a user