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
JWT #16989
Comments
Should be fixed by microsoft/TypeScript#16290. Please try it out with |
As @andy-ms mentioned, this is due to a bug in TypeScript (microsoft/TypeScript#16235) The workaround is to use type inference (or casting), for example; const payload = { "foo": "bar" }
jwt.sign(payload, secret) |
@mdebruijne Thanks, already did that. |
Hi thread, we're moving DefinitelyTyped to use GitHub Discussions for conversations the To help with the transition, we're closing all issues which haven't had activity in the last 6 months, which includes this issue. If you think closing this issue is a mistake, please pop into the TypeScript Community Discord and mention the issue in the |
I'm using VS Code. It's based on TypeScript, it uses all TS definitions. The problem is with
jsonwebtoken
library.jwt.sign(...,)
doesn't have Object.// Type definitions for jsonwebtoken 7.2.0
// Project: https://github.com/auth0/node-jsonwebtoken
// Definitions by: Maxime LUCE https://github.com/SomaticIT, Daniel Heim https://github.com/danielheim
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
In JWT you can pass any object you want, but simple
jwt.sign({userId: 1},...)
doesn't work it says:The text was updated successfully, but these errors were encountered: