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:
parent
5abe0b5fad
commit
afc634b0d2
43 changed files with 573 additions and 3792 deletions
4
main.ts
4
main.ts
|
@ -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.");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue