code: def get_jwt_data(token, token_type):
      
      jwt_data = decode_jwt(
          encoded_token=token,
          secret=current_app.config['JWT_SECRET_KEY'],
          algorithm='HS256',
          identity_claim_key=current_app.config['JWT_IDENTITY_CLAIM'],
          user_claims_key=current_app.config['JWT_USER_CLAIMS']
          )
  
      # token type verification
      if jwt_data['type'] != token_type:
          raise WrongTokenError('Only {} tokens are allowed'.format(token_type))
  
      return jwt_data
docs: Decodes encoded JWT token by using extension setting and validates token type
  
      :param token: The encoded JWT string to decode
      :param token_type: JWT type for type validation (access or refresh)
      :return: Dictionary containing contents of the JWT