File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ function nowEpochSeconds(){
40
40
}
41
41
42
42
function base64urlEncode ( str ) {
43
- return new Buffer ( str )
43
+ return Buffer . from ( str )
44
44
. toString ( 'base64' )
45
45
. replace ( / \+ / g, '-' )
46
46
. replace ( / \/ / g, '_' )
@@ -277,7 +277,7 @@ Parser.prototype.isSupportedAlg = isSupportedAlg;
277
277
Parser . prototype . safeJsonParse = function ( input ) {
278
278
var result ;
279
279
try {
280
- result = JSON . parse ( new Buffer ( base64urlUnescape ( input ) , 'base64' ) ) ;
280
+ result = JSON . parse ( Buffer . from ( base64urlUnescape ( input ) , 'base64' ) ) ;
281
281
} catch ( e ) {
282
282
return e ;
283
283
}
@@ -297,7 +297,7 @@ Parser.prototype.parse = function parse(jwtString,cb){
297
297
var body = this . safeJsonParse ( segments [ 1 ] ) ;
298
298
299
299
if ( segments [ 2 ] ) {
300
- signature = new Buffer ( base64urlUnescape ( segments [ 2 ] ) , 'base64' )
300
+ signature = Buffer . from ( base64urlUnescape ( segments [ 2 ] ) , 'base64' )
301
301
. toString ( 'base64' ) ;
302
302
}
303
303
You can’t perform that action at this time.
0 commit comments