code: def _verify(
          self,
          request,
          return_payload=False,
          verify=True,
          raise_missing=False,
          request_args=None,
          request_kwargs=None,
          *args,
          **kwargs
      ):
          
          try:
              token = self._get_token(request)
              is_valid = True
              reason = None
          except (
              exceptions.MissingAuthorizationCookie,
              exceptions.MissingAuthorizationQueryArg,
              exceptions.MissingAuthorizationHeader,
          ) as e:
              token = None
              is_valid = False
              reason = list(e.args)
              status = e.status_code if self.config.debug() else 401
  
              if raise_missing:
                  if not self.config.debug():
                      e.status_code = 401
                  raise e
  
          if token:
              try:
                  payload = self._decode(token, verify=verify)
  
                  if verify:
                      if self._extra_verifications:
                          self._verify_extras(payload)
                      if self._custom_claims:
                          self._verify_custom_claims(payload)
              except (
                  jwt.exceptions.ExpiredSignatureError,
                  jwt.exceptions.InvalidIssuerError,
                  jwt.exceptions.ImmatureSignatureError,
                  jwt.exceptions.InvalidIssuedAtError,
                  jwt.exceptions.InvalidAudienceError,
                  InvalidVerificationError,
                  InvalidCustomClaimError,
              ) as e:
                  # Make sure that the reasons all end with '.' for consistency
                  reason = [
                      x if x.endswith(".") else "{}.".format(x)
                      for x in list(e.args)
                  ]
                  payload = None
                  status = 401
                  is_valid = False
              except jwt.exceptions.DecodeError as e:
                  self._reasons = e.args
                  # Make sure that the reasons all end with '.' for consistency
                  reason = (
                      [
                          x if x.endswith(".") else "{}.".format(x)
                          for x in list(e.args)
                      ]
                      if self.config.debug()
                      else "Auth required."
                  )
                  logger.debug(e.args)
                  is_valid = False
                  payload = None
                  status = 400 if self.config.debug() else 401
          else:
              payload = None
  
          if return_payload:
              return payload
  
          status = 200 if is_valid else status
  
          return is_valid, status, reason
docs: Verify that a request object is authenticated.