File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
src/cryptography/drivers/node Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " strontium" ,
3
- "version" : " 2.4.0 " ,
3
+ "version" : " 2.4.1 " ,
4
4
"description" : " Strontium is a TypeScript toolkit for High Performance API servers built for Production not Projects." ,
5
5
"main" : " lib/src/index.js" ,
6
6
"types" : " lib/src/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { JWTSigner } from "../../abstract/JWTSigner"
3
3
4
4
// Types are dodgy on this library
5
5
// @ts -ignore
6
- import { decode , encode } from "base64url"
6
+ import { decode , encode , fromBase64 } from "base64url"
7
7
8
8
export class AsymmetricJWTSigner extends JWTSigner {
9
9
constructor (
@@ -30,9 +30,7 @@ export class AsymmetricJWTSigner extends JWTSigner {
30
30
new Buffer ( `${ encodedHeader } .${ encodedClaim } ` )
31
31
)
32
32
33
- return `${ encodedHeader } .${ encodedClaim } .${ signature . toString (
34
- "base64"
35
- ) } `
33
+ return `${ encodedHeader } .${ encodedClaim } .${ fromBase64 ( signature . toString ( "base64" ) ) } `
36
34
}
37
35
38
36
public async verify ( token : string ) : Promise < unknown > {
@@ -56,7 +54,7 @@ export class AsymmetricJWTSigner extends JWTSigner {
56
54
57
55
let claimBody = claimComponents [ 1 ]
58
56
59
- let decodedSignature = new Buffer ( claimComponents [ 2 ] , "base64" )
57
+ let decodedSignature = new Buffer ( decode ( claimComponents [ 2 ] ) )
60
58
61
59
// Delegate validation of the signature to the signer
62
60
await this . signer . verify (
You can’t perform that action at this time.
0 commit comments