From 38d4d8102e534fffa65af51dd9852e19c64c967a Mon Sep 17 00:00:00 2001 From: drlappies Date: Fri, 25 Aug 2023 23:48:04 +0800 Subject: [PATCH] refactor: allow generic in decode return type --- lib/jwt.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/jwt.service.ts b/lib/jwt.service.ts index 5d688c7f..32fa84af 100644 --- a/lib/jwt.service.ts +++ b/lib/jwt.service.ts @@ -123,11 +123,11 @@ export class JwtService { ) as Promise; } - decode( + decode( token: string, options?: jwt.DecodeOptions - ): null | { [key: string]: any } | string { - return jwt.decode(token, options); + ): T { + return jwt.decode(token, options) as T; } private mergeJwtOptions(