mirror of
https://github.com/bitwarden/server.git
synced 2025-02-16 01:51:21 +01:00
Use a user-based known device check (#2318)
This commit is contained in:
parent
13e33cd789
commit
c8783ced6d
@ -91,8 +91,8 @@ public class AuthRequestsController : Controller
|
||||
}
|
||||
if (_globalSettings.PasswordlessAuth.KnownDevicesOnly)
|
||||
{
|
||||
var d = await _deviceRepository.GetByIdentifierAsync(model.DeviceIdentifier);
|
||||
if (d == null || d.UserId != user.Id)
|
||||
var devices = await _deviceRepository.GetManyByUserIdAsync(user.Id);
|
||||
if (devices == null || !devices.Any(d => d.Identifier == model.DeviceIdentifier))
|
||||
{
|
||||
throw new NotFoundException();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user