Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Error State in SignJWT (?) #221

Closed
2 tasks done
jvanalst opened this issue Jun 30, 2021 · 0 comments
Closed
2 tasks done

Missing Error State in SignJWT (?) #221

jvanalst opened this issue Jun 30, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@jvanalst
Copy link

Describe the bug

TypeError: Cannot read property 'crit' of undefined
at SignJWT.sign (C:\Users\jvana\Desktop\Work\edrego\node_modules\jose\dist\node\cjs\jwt\sign.js:17:42)

To Reproduce

Code to reproduce the behaviour:

await new SignJWT({
    customer: 'abc123',
}).sign(crypto.createPrivateKey(config.local.privatekey));

Expected behaviour

It should throw an error, but I think because the _protectedHeader isn't initialized it never makes it to the actual throw.

Environment:

  • jose version: v3.13.0
  • affected runtime is: Node.js 14.16.1

Additional context
Add any other context about the problem here.

  • the bug is happening on latest jose too.
  • i have searched the issues tracker on github for similar issues and couldn't find anything related.
@panva panva closed this as completed in 4103719 Jul 1, 2021
@panva panva added bug Something isn't working and removed triage labels Jul 2, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Oct 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants