From 76e82b7ad27ea65231dd7ba49bd48cb41727c128 Mon Sep 17 00:00:00 2001 From: addison Date: Thu, 29 Sep 2022 12:42:00 -0400 Subject: [PATCH 1/2] Block unknown devices from initiating auth requests --- src/Api/Controllers/AuthRequestsController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Api/Controllers/AuthRequestsController.cs b/src/Api/Controllers/AuthRequestsController.cs index 32c4ef84676c..82a22f6fe265 100644 --- a/src/Api/Controllers/AuthRequestsController.cs +++ b/src/Api/Controllers/AuthRequestsController.cs @@ -89,9 +89,9 @@ public async Task Post([FromBody] AuthRequestCreateReq { 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) { throw new NotFoundException(); From acf1e971da43e7b6df6161afda3c153df8e8083b Mon Sep 17 00:00:00 2001 From: addison Date: Thu, 29 Sep 2022 12:42:18 -0400 Subject: [PATCH 2/2] Rename anonymousHub route to anonymous-hub --- src/Notifications/Startup.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Notifications/Startup.cs b/src/Notifications/Startup.cs index c548e9072bd4..14f88f7b24ad 100644 --- a/src/Notifications/Startup.cs +++ b/src/Notifications/Startup.cs @@ -113,7 +113,7 @@ public void Configure( options.ApplicationMaxBufferSize = 2048; options.TransportMaxBufferSize = 4096; }); - endpoints.MapHub("/anonymousHub", options => + endpoints.MapHub("/anonymous-hub", options => { options.ApplicationMaxBufferSize = 2048; options.TransportMaxBufferSize = 4096;