mirror of
https://github.com/bitwarden/server.git
synced 2025-05-20 19:14:32 -05: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)
|
if (_globalSettings.PasswordlessAuth.KnownDevicesOnly)
|
||||||
{
|
{
|
||||||
var d = await _deviceRepository.GetByIdentifierAsync(model.DeviceIdentifier);
|
var devices = await _deviceRepository.GetManyByUserIdAsync(user.Id);
|
||||||
if (d == null || d.UserId != user.Id)
|
if (devices == null || !devices.Any(d => d.Identifier == model.DeviceIdentifier))
|
||||||
{
|
{
|
||||||
throw new NotFoundException();
|
throw new NotFoundException();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user