Don't throw exception on unauthenticated requests

This commit is contained in:
Cody Robibero
2021-11-13 07:27:28 -07:00
parent 8868b34d78
commit 4a28f46cac
4 changed files with 14 additions and 2 deletions

View File

@@ -35,7 +35,12 @@ namespace Emby.Server.Implementations.HttpServer
/// <inheritdoc />
public async Task WebSocketRequestHandler(HttpContext context)
{
_ = await _authService.Authenticate(context.Request).ConfigureAwait(false);
var authorizationInfo = await _authService.Authenticate(context.Request).ConfigureAwait(false);
if (!authorizationInfo.IsAuthenticated)
{
throw new SecurityException("Token is required");
}
try
{
_logger.LogInformation("WS {IP} request", context.Connection.RemoteIpAddress);