File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -154,12 +154,14 @@ JWTOption<Name, Schema>) => {
154
154
crit
155
155
} )
156
156
157
- if ( morePayloadNbf !== undefined ) {
158
- jwt = jwt . setNotBefore ( morePayloadNbf )
157
+ const setNbf = morePayloadNbf ?? nbf ;
158
+ if ( setNbf !== undefined ) {
159
+ jwt = jwt . setNotBefore ( setNbf )
159
160
}
160
161
161
- if ( morePayloadExp !== undefined ) {
162
- jwt = jwt . setExpirationTime ( morePayloadExp )
162
+ const setExp = morePayloadExp ?? exp ;
163
+ if ( setExp !== undefined ) {
164
+ jwt = jwt . setExpirationTime ( setExp )
163
165
}
164
166
165
167
return jwt . sign ( key )
Original file line number Diff line number Diff line change @@ -27,10 +27,7 @@ describe('JWT Plugin', () => {
27
27
. post (
28
28
'/sign-token' ,
29
29
( { jwt, body } ) =>
30
- jwt . sign ( {
31
- name : body . name ,
32
- exp : '30m'
33
- } ) ,
30
+ jwt . sign ( body ) ,
34
31
{
35
32
body : t . Object ( {
36
33
name : t . String ( )
You can’t perform that action at this time.
0 commit comments