From dda92d4efc1c4b6d83a5a2a2a1fe637f6d83f58f Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 30 Oct 2022 17:39:39 -0500 Subject: fix signalR api key support --- src/slskd/Common/CommonExtensions.cs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/slskd/Common/CommonExtensions.cs') diff --git a/src/slskd/Common/CommonExtensions.cs b/src/slskd/Common/CommonExtensions.cs index 9cf80a4a..29383fcb 100644 --- a/src/slskd/Common/CommonExtensions.cs +++ b/src/slskd/Common/CommonExtensions.cs @@ -20,6 +20,7 @@ namespace slskd using System; using System.Collections; using System.Collections.Generic; + using System.IdentityModel.Tokens.Jwt; using System.IO; using System.Linq; using System.Numerics; @@ -177,6 +178,14 @@ namespace slskd return str.Substring(0, pos) + replacement + str.Substring(pos + phrase.Length); } + /// + /// Serializes the JWT. + /// + /// The JWT. + /// The serialized string. + public static string Serialize(this JwtSecurityToken jwt) + => new JwtSecurityTokenHandler().WriteToken(jwt); + /// /// Formats byte to nearest size (KB, MB, etc.) /// -- cgit v1.2.3