From 7ed913a13e82d5d42072a2e59fb32753be7a7fb2 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Fri, 6 Sep 2024 08:59:17 -0400 Subject: [PATCH] Update index.mdx --- .../configuration/authentication/index.mdx | 49 ++++++++++++++++++- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/pages/docs/configuration/authentication/index.mdx b/pages/docs/configuration/authentication/index.mdx index 463c7e43a..04fd8fba6 100644 --- a/pages/docs/configuration/authentication/index.mdx +++ b/pages/docs/configuration/authentication/index.mdx @@ -22,8 +22,9 @@ Here's an overview of the general configuration. > **Note:** OpenID does not support the ability to disable only registration. ->> **Quick Tip:** Even with registration disabled, add users directly to the database using `npm run create-user`. If you can't get npm to work, try `sudo docker exec -ti LibreChat sh` first to "ssh" into the container. ->> **Quick Tip:** To delete a user, you can run `docker-compose exec api npm run delete-user email@domain.com` +Quick Tips: +- Even with registration disabled, you can add users directly to the database using the create-user script. +- To delete a user, you can use the delete-user script.
@@ -94,3 +95,47 @@ To set up the mod system, review [the setup guide](/docs/configuration/mod_syste > *Please Note: If you want this to work in development mode, you will need to create a file called `.env.development` in the root directory and set `DOMAIN_CLIENT` to `http://localhost:3090` or whatever port is provided by vite when runnning `npm run frontend-dev`* +## User Management Scripts + +### Create User Script + +The create-user script allows you to add users directly to the database, even when registration is disabled. Here's how to use it: + +1. For the default docker-compose.yml: + ``` + docker-compose exec api npm run create-user + ``` + +2. For the deploy-compose.yml: + ``` + docker exec -it LibreChat-API /bin/sh -c "cd .. && npm run create-user" + ``` + +3. For local development (from project root): + ``` + npm run create-user + ``` + +Follow the prompts to enter the new user's email and password. + +### Delete User Script + +To delete a user, you can use the delete-user script: + +1. For the default docker-compose.yml: + ``` + docker-compose exec api npm run delete-user email@domain.com + ``` + +2. For the deploy-compose.yml: + ``` + docker exec -it LibreChat-API /bin/sh -c "cd .. && npm run delete-user email@domain.com" + ``` + +3. For local development (from project root): + ``` + npm run delete-user email@domain.com + ``` + +Replace `email@domain.com` with the email of the user you want to delete. +