How to properly extract payload from nestjs/jwt token?

I ran into a problem with decrypting a token in a project, I want to extract data from the incoming token, compare it with the data from the database, and then perform certain actions.
The problem is that when I get the payload from “jwtService.decode()”, I can’t access the “decodedJwt.email” field, nest complains that “decodedJwt” is not an object. But if you return typeof “decodedJwt” then the answer is a string. However, I cannot access the “email” field in the code itself. If I return “decodedJwt” in this function, then in postman I will get the very necessary object with the necessary fields, including the same “email” field. What’s my mistake?

Reply from nest:
Property ’email’ does not exist on type ‘string | { [key: string]: any; }’.
Property “email” does not exist on type “string”.ts(2339)

async refreshTokenByOldToken(authHeader: string) {
  const decodedJwt = this.jwtService.decode(authHeader.split(' ')[1])
  return decodedJwt.email
}