mud_server.admin_gradio.tabs.register_tab

Register Tab for MUD Client.

This module provides the registration interface for creating new user accounts. Visible only when not logged in.

Migration Notes:
  • Migrated from old api_client.py to new modular structure

  • Uses AuthAPIClient for registration API calls

  • Extracts message from API response dict for Gradio display

Functions

register(username, password, password_confirm)

Handle new user account registration.

create()

Create the Register tab with account creation form.

Module Contents

mud_server.admin_gradio.tabs.register_tab.register(username, password, password_confirm)[source]

Handle new user account registration.

Validates input, sends registration request to backend API via AuthAPIClient, and returns status message indicating success or failure.

This function wraps the new AuthAPIClient.register() method to maintain compatibility with the Gradio interface while using the new modular API.

Parameters:
  • username (str) – Desired username for new account

  • password (str) – Plain text password for new account

  • password_confirm (str) – Password confirmation (must match password)

Returns:

String message indicating registration success or failure

Return type:

str

Examples

>>> result = register("alice", "password123", "password123")
>>> "You can now login" in result
True
mud_server.admin_gradio.tabs.register_tab.create()[source]

Create the Register tab with account creation form.

Returns:

(register_tab, register_btn) - Tab component and register button for event wiring

Return type:

tuple