From 7190c888d7216485db860566f0e89037d7aab972 Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 16 May 2021 20:17:55 +0800 Subject: fix: Fix backend signalr auth. --- BackEnd/Timeline/Auth/MyAuthenticationHandler.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'BackEnd/Timeline/Auth') diff --git a/BackEnd/Timeline/Auth/MyAuthenticationHandler.cs b/BackEnd/Timeline/Auth/MyAuthenticationHandler.cs index 949dd832..016cc938 100644 --- a/BackEnd/Timeline/Auth/MyAuthenticationHandler.cs +++ b/BackEnd/Timeline/Auth/MyAuthenticationHandler.cs @@ -100,6 +100,17 @@ namespace Timeline.Auth } } + { + var token = Request.Query["access_token"]; + var path = Context.Request.Path; + + if (!string.IsNullOrEmpty(token) && path.StartsWithSegments("/api/hub")) + { + _logger.LogInformation(Resource.LogTokenFoundInQuery, "access_token", token); + return token; + } + } + // not found anywhere then return null return null; } -- cgit v1.2.3