code: def verify_token(token: str) -> t.Union[User, None]:
      try:
          data = jwt.decode(
              token.encode("ascii"),
              current_app.config["SECRET_KEY"],
          )
          id = data["id"]
          user = get_user_by_id(id)
      except JoseError:
          return None
      except IndexError:
          return None
      return user
  
file_path: apiflask/examples/auth/token_auth/app.py
imports: import typing
  from flask import current_app
  from apiflask import APIFlask, HTTPTokenAuth, Schema, abort
  from apiflask.fields import String
  from authlib.jose import jwt, JoseError
label_desc: Use image node_id 2 for calling a global function with example usage: verify_token(token) and returns: user, None, None