Skip to content

ottin4ttc/invite-code-interception

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Invite Code Interception

This module provides a system to verify users against invite codes. It can be easily integrated into OpenClaw installations.

Features

  • Validate invite codes.
  • Bind users to specific invite codes.
  • Persist user and code states.

Installation

Step 1: Copy the Module

Place the invite-code-interception directory in the OpenClaw workspace or skills folder.

Step 2: Ensure Storage Path

Check that the memory/invite_codes.json file exists within the module's memory/ directory.

Step 3: Integrate with OpenClaw

You can directly call the verify_user function from auth_check.py.

Step 4: Restart OpenClaw

Restart the OpenClaw instance after adding the module to ensure proper initialization.

Usage

Function: verify_user

Parameters:

  • openid (str): Unique identifier for the user.
  • code (str): Invite code to verify.

Responses:

  • ALREADY_VERIFIED: The user has already been verified.
  • INVALID_CODE: The provided code is invalid.
  • VERIFICATION_SUCCESS: The user was successfully bound to the invite code.
  • CODE_ALREADY_USED: The code has already been used by another user.

Example Usage

from auth_check import verify_user

result = verify_user("user_12345", "gAfzRbDmqPFqjANN")
print(result)

Notes

  1. Default storage path is memory/invite_codes.json. Ensure the directory is writable.
  2. Modify or extend invite_codes.json to add/remove invite codes as needed.
  3. A JSON file must exist in the specified path for proper functionality.

Contributing

Feel free to modify the logic or data storage format to suit your OpenClaw instance's needs.

About

Invite code verification module for OpenClaw

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages