Closed F2BEAR closed 1 year ago
preventing me from using strings like 1h or 2.5 weeks as the exp value.
That's not how the payload you can pass to the constructor is working. That's for the instance method setExpirationTime
.
which in the docs is stated that it's type is
string | number
Where does it state that? The docs are generated from the types so I doubt that's what's in the docs for the payload argument.
Damn, you are right.
I expected the exp
value for the constructor to be of the same type as the one on the setExpirationTime
method for no reason; my bad.
Feeling kinda dummy now, sorry for the trouble.
What happened?
I'm trying to generate a JWT using the exp from user's prompt for the
SignJWT
class which in the docs is stated that it's type isstring | number
but Typescript is displaying an error stating that the exp type isnumber | undefined
preventing me from using strings like1h
or2.5 weeks
as the exp value.Version
v4.14.4
Runtime
Browser
Runtime Details
v18.16.0
Code to reproduce
Required