elysiajs / elysia-jwt

Plugin for Elysia for using JWT Authentication
MIT License
41 stars 16 forks source link

Cannot pass entries from type JWTPayloadSpec into jwt.sign() #12

Closed Nmans01 closed 1 year ago

Nmans01 commented 1 year ago

Problem: The argument morePayload of jwt.sign() is of type Record<string, string> & JWTPayloadSpec. This typing does not allow the field exp to be defined, among others, since JWTPayloadSpec defines their values as numbers, violating the Record<string, string> definition.

image

Nmans01 commented 1 year ago

Closing, as I overlooked some of the options of use(jwt()), including the schema field.