Skip to content

Commit b360a53

Browse files
committed
fix(jwt): prevent null reference in LifetimeValidator for tokens without exp
1 parent 8731d85 commit b360a53

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/WART-Core/Authentication/JWT/JwtServiceCollectionExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public static IServiceCollection AddJwtMiddleware(this IServiceCollection servic
6363
options.TokenValidationParameters =
6464
new TokenValidationParameters
6565
{
66-
LifetimeValidator = (before, expires, token, parameters) => expires > DateTime.UtcNow,
66+
LifetimeValidator = (before, expires, token, parameters) => expires != null && expires > DateTime.UtcNow,
6767
ValidateAudience = false,
6868
ValidateIssuer = false,
6969
ValidateActor = false,

0 commit comments

Comments
 (0)