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)
27
27
Scopes = options . Scopes ?? [ ] ,
28
28
Claims = options . Claims ?? [ ] ,
29
29
NotBefore = DateTime . UtcNow ,
30
- ExpiresOn = DateTime . UtcNow . AddMinutes ( options . ValidFor == 0 ? 60 : options . ValidFor )
30
+ ExpiresOn = DateTime . UtcNow . AddMinutes ( options . ValidFor ?? 60 )
31
31
} ;
32
32
}
33
33
}
Original file line number Diff line number Diff line change @@ -11,5 +11,5 @@ public class JwtOptions
11
11
public IEnumerable < string > ? Roles { get ; set ; }
12
12
public IEnumerable < string > ? Scopes { get ; set ; }
13
13
public Dictionary < string , string > ? Claims { get ; set ; }
14
- public double ValidFor { get ; set ; }
14
+ public double ? ValidFor { get ; set ; }
15
15
}
Original file line number Diff line number Diff line change @@ -18,16 +18,6 @@ internal static string CreateToken(JwtOptions jwtOptions)
18
18
) ;
19
19
20
20
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 ) ;
32
22
}
33
23
}
You can’t perform that action at this time.
0 commit comments