Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,8 @@ Requirements:
```sh
bun dev
```
5. (Optional, for logging into the admin panel locally) Seed a test user with Telegram already linked and the `owner` role:
```sh
bun run seed:user
```
The script sends a sign-in OTP to `test@example.com` and prints a link to a temporary inbox where you can read the code — paste it when prompted. Without this step, logging into admin with `test@example.com` lands on the "Link your Telegram account" onboarding page, since that account has no `telegramId` associated yet. Re-run with `--force` to recreate the test user from scratch.
Comment thread
BIA3IA marked this conversation as resolved.
1 change: 1 addition & 0 deletions scripts/seed-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const force = argv.includes("--force")
const existing = await DB.select().from(SCHEMA.AUTH.user).where(eq(SCHEMA.AUTH.user.email, testUser.email)).limit(1)
if (existing.length === 1) {
if (force) {
await DB.delete(SCHEMA.TG.link).where(eq(SCHEMA.TG.link.userId, existing[0].id))
await DB.delete(SCHEMA.AUTH.user).where(eq(SCHEMA.AUTH.user.email, testUser.email))
console.warn("SEED: test user deleted for recreation by using --force flag")
} else {
Expand Down