File tree Expand file tree Collapse file tree 4 files changed +3
-44
lines changed Expand file tree Collapse file tree 4 files changed +3
-44
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ public static JwtCreatorOptions Create(JwtOptions options)
2727 Scopes = options . Scopes ?? [ ] ,
2828 Claims = options . Claims ?? [ ] ,
2929 NotBefore = DateTime . UtcNow ,
30- ExpiresOn = DateTime . UtcNow . AddMinutes ( options . ValidFor == 0 ? 60 : options . ValidFor )
30+ ExpiresOn = DateTime . UtcNow . AddMinutes ( options . ValidFor ?? 60 )
3131 } ;
3232 }
3333}
Original file line number Diff line number Diff line change @@ -11,5 +11,5 @@ public class JwtOptions
1111 public IEnumerable < string > ? Roles { get ; set ; }
1212 public IEnumerable < string > ? Scopes { get ; set ; }
1313 public Dictionary < string , string > ? Claims { get ; set ; }
14- public double ValidFor { get ; set ; }
14+ public double ? ValidFor { get ; set ; }
1515}
Original file line number Diff line number Diff line change @@ -18,16 +18,6 @@ internal static string CreateToken(JwtOptions jwtOptions)
1818 ) ;
1919
2020 var jwtToken = jwtIssuer . CreateSecurityToken ( options ) ;
21-
22- var jwt = Jwt . Create (
23- options . Scheme ,
24- jwtToken ,
25- new JwtSecurityTokenHandler ( ) . WriteToken ( jwtToken ) ,
26- options . Scopes ,
27- options . Roles ,
28- options . Claims
29- ) ;
30-
31- return jwt . Token ;
21+ return new JwtSecurityTokenHandler ( ) . WriteToken ( jwtToken ) ;
3222 }
3323}
You can’t perform that action at this time.
0 commit comments