diff options
| author | JP Dillingham <jp@dillingham.me> | 2023-01-07 19:36:30 -0600 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2023-01-07 19:36:30 -0600 |
| commit | 177d12ef77488ae914045962e4d3a4ce24cdbc25 (patch) | |
| tree | 9e9fcbee790f2bad2f6ef804e79a8300e937e98b /src/slskd/Core/API | |
| parent | 384a388a2e4496bf35de835b811014d84f58b9fb (diff) | |
| download | slskd-177d12ef77488ae914045962e4d3a4ce24cdbc25.tar.gz | |
handle null nbf claim
Diffstat (limited to 'src/slskd/Core/API')
| -rw-r--r-- | src/slskd/Core/API/DTO/TokenResponse.cs | 2 |
1 files changed, 1 insertions, 1 deletions
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 /// <summary> /// Gets the value of the Not Before claim from the Access Token. /// </summary> - 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()); /// <summary> /// Gets the Access Token string. |
