This module provides a system to verify users against invite codes. It can be easily integrated into OpenClaw installations.
- Validate invite codes.
- Bind users to specific invite codes.
- Persist user and code states.
Place the invite-code-interception directory in the OpenClaw workspace or skills folder.
Check that the memory/invite_codes.json file exists within the module's memory/ directory.
You can directly call the verify_user function from auth_check.py.
Restart the OpenClaw instance after adding the module to ensure proper initialization.
- openid (
str): Unique identifier for the user. - code (
str): Invite code to verify.
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.
from auth_check import verify_user
result = verify_user("user_12345", "gAfzRbDmqPFqjANN")
print(result)- Default storage path is
memory/invite_codes.json. Ensure the directory is writable. - Modify or extend
invite_codes.jsonto add/remove invite codes as needed. - A JSON file must exist in the specified path for proper functionality.
Feel free to modify the logic or data storage format to suit your OpenClaw instance's needs.