mirror of
https://github.com/bitwarden/server
synced 2025-12-21 10:43:44 +00:00
[SG-692] Block unknown devices from using passwordless auth (#2315)
* Block unknown devices from initiating auth requests * Rename anonymousHub route to anonymous-hub
This commit is contained in:
@@ -89,9 +89,9 @@ public class AuthRequestsController : Controller
|
|||||||
{
|
{
|
||||||
throw new BadRequestException("Device type not provided.");
|
throw new BadRequestException("Device type not provided.");
|
||||||
}
|
}
|
||||||
if (!_globalSettings.PasswordlessAuth.KnownDevicesOnly)
|
if (_globalSettings.PasswordlessAuth.KnownDevicesOnly)
|
||||||
{
|
{
|
||||||
var d = await _deviceRepository.GetByIdentifierAsync(_currentContext.DeviceIdentifier);
|
var d = await _deviceRepository.GetByIdentifierAsync(model.DeviceIdentifier);
|
||||||
if (d == null || d.UserId != user.Id)
|
if (d == null || d.UserId != user.Id)
|
||||||
{
|
{
|
||||||
throw new NotFoundException();
|
throw new NotFoundException();
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ public class Startup
|
|||||||
options.ApplicationMaxBufferSize = 2048;
|
options.ApplicationMaxBufferSize = 2048;
|
||||||
options.TransportMaxBufferSize = 4096;
|
options.TransportMaxBufferSize = 4096;
|
||||||
});
|
});
|
||||||
endpoints.MapHub<AnonymousNotificationsHub>("/anonymousHub", options =>
|
endpoints.MapHub<AnonymousNotificationsHub>("/anonymous-hub", options =>
|
||||||
{
|
{
|
||||||
options.ApplicationMaxBufferSize = 2048;
|
options.ApplicationMaxBufferSize = 2048;
|
||||||
options.TransportMaxBufferSize = 4096;
|
options.TransportMaxBufferSize = 4096;
|
||||||
|
|||||||
Reference in New Issue
Block a user