mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 02:45:39 -04:00
Add auto-close registration and admin settings page
First user to register automatically becomes admin and registration closes. Admins can re-open registration from a new settings page. Uses Better Auth admin plugin for role management and a new appSettings table for the registration flag. Mobile tab bar now links to settings instead of inline logout. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,10 @@ export const user = sqliteTable("user", {
|
||||
.notNull()
|
||||
.default(false),
|
||||
image: text("image"),
|
||||
role: text("role").default("user"),
|
||||
banned: int("banned", { mode: "boolean" }).default(false),
|
||||
banReason: text("banReason"),
|
||||
banExpires: int("banExpires", { mode: "timestamp" }),
|
||||
createdAt: int("createdAt", { mode: "timestamp" }).notNull(),
|
||||
updatedAt: int("updatedAt", { mode: "timestamp" }).notNull(),
|
||||
});
|
||||
@@ -37,6 +41,7 @@ export const session = sqliteTable("session", {
|
||||
expiresAt: int("expiresAt", { mode: "timestamp" }).notNull(),
|
||||
ipAddress: text("ipAddress"),
|
||||
userAgent: text("userAgent"),
|
||||
impersonatedBy: text("impersonatedBy"),
|
||||
createdAt: int("createdAt", { mode: "timestamp" }).notNull(),
|
||||
updatedAt: int("updatedAt", { mode: "timestamp" }).notNull(),
|
||||
});
|
||||
@@ -277,3 +282,10 @@ export const titleRecommendations = sqliteTable(
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
// ─── App Settings ───────────────────────────────────────────────────
|
||||
|
||||
export const appSettings = sqliteTable("appSettings", {
|
||||
key: text("key").primaryKey(),
|
||||
value: text("value"),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user