Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(sign): fix sign parameters type and usage
The payload and signOptions parameters have incorrect type checking, therefore possibly breaking the jsonwebtoken source code passing invalid payload and sign options. Scenario: if "expiresIn" has been set in the nestjs module and uses payload as a string, it'll break the code, because jsonwebtoken does not allow the use of "expiresIn" option with a string payload. In order to solve the problem, it is necessary predict the developer's behavior using types. Also throw an error in case of incorrect use of the sign method of the JwtService class.
- Loading branch information