Skip to content

Commit a38c1dd

Browse files
authored
Fixed expire check
1 parent 1ca9d33 commit a38c1dd

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Jellyfin.HardwareVisualizer/Server/Controllers/TestDataApiController.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public async Task<IActionResult> GetTestData([Required, FromQuery]Guid platformI
5656
if (testDataToken.retryAfter is not null)
5757
{
5858
Response.Headers.RetryAfter = new StringValues(testDataToken.retryAfter.Value.Seconds.ToString());
59+
5960
return new StatusCodeResult(StatusCodes.Status503ServiceUnavailable);
6061
}
6162

Jellyfin.HardwareVisualizer/Server/Services/SubmitToken/SubmitTokenService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ public bool Validate(JwtPayload token, out TimeSpan? retryAfter)
8484
return (Encrypt(tokenStore.JwtPayload), null);
8585
}
8686

87-
var expiresAt = DateTime.Now.AddHours(4);
87+
var expiresAt = DateTime.UtcNow.AddHours(4);
8888
tokenStore = new TokenStore();
8989
tokenStore.JwtPayload = new JwtPayload("jhwa/server", "jhwa/client", [new Claim("ip", ipAddress)],
90-
DateTime.Now, expiresAt, DateTime.Now);
90+
DateTime.UtcNow, expiresAt, DateTime.UtcNow);
9191

9292
_memoryCache.Set(cacheKey, tokenStore, expiresAt);
9393
return (Encrypt(tokenStore.JwtPayload), null);

0 commit comments

Comments
 (0)