File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,10 @@ export const labelsToClaim: { [key: number]: string } = {
7272} ;
7373
7474const claimTransform : { [ key : string ] : ( value : string ) => Buffer } = {
75- cti : ( value ) => Buffer . from ( value , 'hex' ) ,
75+ cti : ( value : unknown ) =>
76+ value instanceof Uint8Array
77+ ? Buffer . copyBytesFrom ( value )
78+ : Buffer . from ( value as string , 'hex' ) ,
7679 cattpk : ( value ) => Buffer . from ( value , 'hex' )
7780} ;
7881
@@ -237,8 +240,9 @@ function updateMapFromClaims(
237240 CommonAccessTokenIf . fromDictTags ( dict [ param ] as any ) . payload
238241 ) ;
239242 } else {
240- const value = claimTransform [ param ]
241- ? claimTransform [ param ] ( dict [ param ] as string )
243+ const k = param . match ( / \d + / ) ? labelsToClaim [ parseInt ( param ) ] : param ;
244+ const value = claimTransform [ k ]
245+ ? claimTransform [ k ] ( dict [ param ] as string )
242246 : dict [ param ] ;
243247 map . set ( key , value ) ;
244248 }
You can’t perform that action at this time.
0 commit comments