Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

What is default behaviour if expiresIn option not set when signing?

Open
#795 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
28/100
Issue type
Documentation
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript, node.js
Domain
security

Research direction

Start with the jwt.sign call shown in the issue and verify what happens when expiresIn is omitted. Document the resulting expiration behavior in the relevant project documentation, with an example that makes the default clear.

Written by the indexing model from the issue text.

Description

Description

Currently, client can get a client via jwt signing withouth passing a expiresIn attribute. For example,

import jwt from "jsonwebtoken"

const secret = jwt.sign({ a: "a" }, "secret")

console.log(secret)

So what's the default expiring date of the generated token? like after 24 hours, or it never expires?

Environment
  • jsonwebtoken: ^8.5.1
  • Typescript 4.2.4
  • Node 14.17.0
Dominant language
JavaScript
Stars
18.2k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from auth0/node-jsonwebtoken

All issues in auth0/node-jsonwebtoken

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.