code: def generate_jwt_token(user, authsys, **kwargs):
      
      # Local import to prevent app startup failures
      from cloud_inquisitor.config import dbconfig
  
      token = {
          'auth_system': authsys,
          'exp': time.time() + dbconfig.get('session_expire_time'),
          'roles': [role.name for role in user.roles]
      }
  
      if kwargs:
          token.update(**kwargs)
  
      enc = jwt.encode(token, get_jwt_key_data(), algorithm='HS512')
      return enc.decode()
docs: Generate a new JWT token, with optional extra information. Any data provided in `**kwargs`
      will be added into the token object for auth specific usage
  
      Args:
          user (:obj:`User`): User object to generate token for
          authsys (str): The auth system for which the token was generated
          **kwargs (dict): Any optional items to add to the token
  
      Returns:
          Encoded JWT token