A boatload of Bugs (#3704)
Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com>
This commit is contained in:
parent
ea9b7ad0d1
commit
37734554ba
102 changed files with 2051 additions and 1115 deletions
|
@ -18,14 +18,18 @@ public static class JwtHelper
|
|||
// Parse the JWT and extract the expiry claim
|
||||
var jwtHandler = new JwtSecurityTokenHandler();
|
||||
var token = jwtHandler.ReadJwtToken(jwtToken);
|
||||
var exp = token.Claims.FirstOrDefault(c => c.Type == "exp")?.Value;
|
||||
return token.ValidTo;
|
||||
|
||||
if (long.TryParse(exp, CultureInfo.InvariantCulture, out var expSeconds))
|
||||
{
|
||||
return DateTimeOffset.FromUnixTimeSeconds(expSeconds).UtcDateTime;
|
||||
}
|
||||
|
||||
return DateTime.MinValue;
|
||||
// var exp = token.Claims.FirstOrDefault(c => c.Type == "exp")?.Value;
|
||||
//
|
||||
// if (long.TryParse(exp, CultureInfo.InvariantCulture, out var expSeconds))
|
||||
// {
|
||||
// return DateTimeOffset.FromUnixTimeSeconds(expSeconds).UtcDateTime;
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// return DateTime.MinValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue