Spec:
I've following the sample from README.md, but the error was detected.
ESLint: Unexpected await of a non-Promise (non-"Thenable") value. (@typescript-eslint/await-thenable)
Usage:
- sign
const token = await sign(
this.privateKey,
{
userId,
username,
roles,
type: opts.type,
iss: this.issuer,
exp: opts.exp,
},
{ addIat: true, addExp: true },
)
- verify
const { payload } = (await verify(this.publicKey, token)) as { payload: AuthPayload }
if (!payload) throw new UnauthorizedException('Failed to verify token')
else if (payload.type !== type) throw new UnauthorizedException('Invalid token type')
Spec:
I've following the sample from README.md, but the error was detected.
ESLint: Unexpectedawaitof a non-Promise (non-"Thenable") value. (@typescript-eslint/await-thenable)Usage: