docs: update admin user creation instructions
This commit is contained in:
@@ -37,6 +37,35 @@ EuchreCamp is a Next.js 14+ application for managing Euchre tournaments and trac
|
||||
|
||||
## Common Tasks
|
||||
|
||||
### Admin User Creation
|
||||
|
||||
To create an admin user, use the provided scripts:
|
||||
|
||||
**Option 1: Using Better Auth API (Recommended)**
|
||||
```bash
|
||||
node scripts/create-admin-via-api.js
|
||||
```
|
||||
This creates the admin user `david@dhg.lol` with password `adminadmin` using Better Auth's internal API.
|
||||
|
||||
**Option 2: Direct Database Creation**
|
||||
```bash
|
||||
node scripts/create-admin-better-auth.js
|
||||
```
|
||||
This creates the admin user `david@dhg.lol` with password `admin` directly in the database.
|
||||
|
||||
**List All Users:**
|
||||
```bash
|
||||
node scripts/list-users.js
|
||||
```
|
||||
|
||||
**Update Admin Password:**
|
||||
```bash
|
||||
node scripts/update-admin-password.js
|
||||
```
|
||||
This updates the admin password to `adminadmin`.
|
||||
|
||||
**Note:** All scripts currently create the user `david@dhg.lol`. If you need to create a different admin user, you can modify the email in the script or use Better Auth's CLI.
|
||||
|
||||
### Fixing Authentication Issues
|
||||
If users are redirected incorrectly or permissions aren't working:
|
||||
1. Check if cookie cache is disabled in `src/lib/auth.ts`
|
||||
|
||||
Reference in New Issue
Block a user