nl_tokens: require - requires that data in the JWT s payload meets certain requirements If only the key is passed it simply checks that payload [ key ] == true
pl_tokens: function ( key , operator , value ) { if ( ! key ) { throw new ReferenceError ( 'key must be defined' ) ; } if ( operator && [ '==' , '===' , '!=' , '!==' , '<' , '<=' , '>' , '>=' ] . indexOf ( operator ) === - 1 ) { throw new JWTExpressError ( 'Invalid operator: ' + operator ) ; } return function ( req , res , next ) { var jwt = req [ this . options . reqProperty ] || { payload : { } } , data = jwt . payload [ key ] , ok ; if ( ! operator ) { ok = ! ! data ; } else if ( operator == '==' ) { ok = data == value ; } else if ( operator == '===' ) { ok = data === value ; } else if ( operator == '!=' ) { ok = data != value ; } else if ( operator == '!==' ) { ok = data !== value ; } else if ( operator == '<' ) { ok = data < value ; } else if ( operator == '<=' ) { ok = data <= value ; } else if ( operator == '>' ) { ok = data > value ; } else if ( operator == '>=' ) { ok = data >= <mask> ; } if ( ! ok ) { var err = new JWTExpressError ( 'JWT is insufficient' ) ; err . key = key ; err . data = data ; err . operator = operator ; err . value = value ; next ( err ) ; } else { next ( ) ; } } . bind ( this ) ; }