Vonage / vonage-cli

Vonage CLI tool.
Apache License 2.0
17 stars 13 forks source link

[Bug]: vonage cli failed generate jwt token with the parameter "exp" #124

Open gcp91020 opened 5 months ago

gcp91020 commented 5 months ago

Node Version

20.x

Platform

Mac (Apple Silcon)

CLI Version

@vonage/cli/1.2.4 darwin-arm64 node-v20.11.0

Command

vonage jwt --key_file=private.key --app_id=12345678 --exp=1706692448

Expected Behavior

With the command, I got the error 'Error: "exp" should be a number of seconds'

Actual Behavior

It is easy to fix this issue. in the file /usr/local/lib/node_modules/@vonage/cli/dist/commands/jwt/index.js change line 13: from: exp: flags.exp || Date.now() + 21600, to: exp: parseInt(flags.exp) || Date.now() + 21600,

manchuck commented 5 months ago

Strange that is needed since we define exp as a number : https://github.com/Vonage/vonage-cli/blob/cf43cd8906213336721dbb8c0853a6546817b18a/packages/cli/src/commands/jwt/index.ts#L28

I can take a stab at this next week