code: def get_token_status(self, token, serializer, max_age=None, return_data=False):
          
          serializer = getattr(self.security, serializer + '_serializer')
  
          td = self.get_within_delta(max_age)
          max_age = td.seconds + td.days * 24 * 3600
          user, data = None, None
          expired, invalid = False, False
  
          try:
              data = serializer.loads(token, max_age=max_age)
          except SignatureExpired:
              d, data = serializer.loads_unsafe(token)
              expired = True
          except (BadSignature, TypeError, ValueError):
              invalid = True
  
          if data:
              user = self.user_manager.get(data[0])
  
          expired = expired and (user is not None)
  
          if return_data:
              return expired, invalid, user, data
          else:
              return expired, invalid, user
docs: Get the status of a token.
  
          :param token: The token to check
          :param serializer: The name of the serializer. Can be one of the
                             following: ``confirm``, ``login``, ``reset``
          :param max_age: The name of the max age config option. Can be one of
                          the following: ``SECURITY_CONFIRM_EMAIL_WITHIN`` or
                          ``SECURITY_RESET_PASSWORD_WITHIN``