1
0
Fork 0
mirror of https://git.sr.ht/~roxwize/mipilin synced 2025-05-10 23:33:07 +00:00

uhhh yeah

Signed-off-by: roxwize <rae@roxwize.xyz>
This commit is contained in:
Rae 5e 2024-12-25 18:44:29 -05:00
parent 5abe0b5fad
commit afc634b0d2
Signed by: rae
GPG key ID: 5B1A0FAB9BAB81EE
43 changed files with 573 additions and 3792 deletions

View file

@ -20,7 +20,7 @@ import adminRoutes from "./routes/admin.js";
import loginRoutes from "./routes/login.js";
import userRoutes from "./routes/users.js";
import updateRoutes from "./routes/updates.js";
import { createInviteCode, getMoods, render, setNonce } from "./routes/util.js";
import { createInviteCode, getMoods, render, setNonce, UserStatus } from "./routes/util.js";
const db = drizzle(process.env.DATABASE_URL!);
@ -117,7 +117,7 @@ async function init(app: Express, db: NodePgDatabase) {
const totalUsers = await db.select({ value: count() }).from(users);
if (totalUsers[0].value === 0) {
console.log("There are no users registered. Creating a temporary invite code right now.");
console.log(" " + await createInviteCode(db, 0, new Date(Date.now() + (1 * 1000 * 60)), true));
console.log(" " + await createInviteCode(db, 0, new Date(Date.now() + (1 * 1000 * 60)), UserStatus.MODERATOR));
console.log("This code expires in 1 minute and will confer admin powers to whoever signs up with it.");
}
}