User Management

Commands for creating and managing user accounts in PteroCA.

Create New User

The pteroca:user:create command is used to create a new user in the system by specifying an email, password, and an optional role. While this command is automatically executed during the pteroca:system:configure process to create the initial administrator account, it can also be run separately to create additional users at any time.

  • Command: pteroca:user:create

  • Alias: app:create-new-user (deprecated, removed in v1.0.0)

Integration

If a connection to the Pterodactyl API is established, this command simultaneously creates a user in Pterodactyl with the same credentials, ensuring seamless integration between the panel and Pterodactyl.

Arguments

  • email (required): The email address of the user

  • password (required): The password for the user

  • role (optional): The role assigned to the user (default: ROLE_USER)

    • System roles: ROLE_ADMIN (full access), ROLE_USER (basic user access)

    • Custom roles: Starting with v0.6, you can also specify any custom role name you've created in the Admin Panel (e.g., Moderator, Support, ShopManager)

    • The command validates the role provided. If the role doesn't exist, it defaults to ROLE_USER

    • For information about creating custom roles, see Access Control

Examples

Process Overview

  • During pteroca:system:configure, this command is automatically triggered to create the first user (typically an administrator)

  • When run separately, it allows administrators to create additional users as needed

  • The command validates the role provided:

    • System roles (ROLE_ADMIN, ROLE_USER) are always valid

    • Custom role names (created in Admin Panel → Roles & Permissions) are validated against the database

    • If an invalid role is passed, it defaults to ROLE_USER

  • If connected to the Pterodactyl API, a user with the same credentials is also created in Pterodactyl

  • Creates Pterodactyl Client API key with fallback option

Change User Password

The pteroca:user:change-password command is used to update the password of an existing user in the system. Like other commands, it integrates with Pterodactyl if an API connection is established, ensuring that the user's password is updated on both the panel and Pterodactyl simultaneously.

  • Command: pteroca:user:change-password

  • Alias: app:change-user-password (deprecated, removed in v1.0.0)

Integration

If a connection to the Pterodactyl API is established, this command simultaneously changes a user password in Pterodactyl with the same credentials, ensuring seamless integration between the panel and Pterodactyl.

Arguments

  • email (required): The email address of the user whose password is being updated

  • password (required): The new password to set for the user

Examples

Last updated