From 177d12ef77488ae914045962e4d3a4ce24cdbc25 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 7 Jan 2023 19:36:30 -0600 Subject: handle null nbf claim --- src/slskd/Core/API/DTO/TokenResponse.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/slskd/Core/API/DTO/TokenResponse.cs') diff --git a/src/slskd/Core/API/DTO/TokenResponse.cs b/src/slskd/Core/API/DTO/TokenResponse.cs index 85992917..47cfd335 100644 --- a/src/slskd/Core/API/DTO/TokenResponse.cs +++ b/src/slskd/Core/API/DTO/TokenResponse.cs @@ -49,7 +49,7 @@ namespace slskd.Core.API /// /// Gets the value of the Not Before claim from the Access Token. /// - public long NotBefore => long.Parse(JwtSecurityToken.Claims.SingleOrDefault(c => c.Type == "nbf").Value); + public long NotBefore => long.Parse(JwtSecurityToken.Claims.SingleOrDefault(c => c.Type == "nbf")?.Value ?? long.MaxValue.ToString()); /// /// Gets the Access Token string. -- cgit v1.2.3