Skip to content

Commit

Permalink
Merge branch 'drlappies-allow-decode-generic-return-type'
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Nov 9, 2023
2 parents 19cbebc + 1133e90 commit 74c2281
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 334 deletions.
6 changes: 3 additions & 3 deletions lib/jwt.service.ts
Expand Up @@ -150,11 +150,11 @@ export class JwtService {
) as Promise<T>;
}

decode(
decode<T = any>(
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(
Expand Down

0 comments on commit 74c2281

Please sign in to comment.