Add verify middleware

This commit is contained in:
Owen Schwartz
2024-10-03 22:31:20 -04:00
parent e89ee4042a
commit a8f944fc78
17 changed files with 1230 additions and 40 deletions

1
server/db/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
names.json

View File

@@ -89,6 +89,16 @@ export const sessions = sqliteTable("session", {
expiresAt: integer("expiresAt").notNull(),
});
export const userOrgs = sqliteTable("userOrgs", {
userId: text("userId")
.notNull()
.references(() => users.id),
orgId: integer("orgId")
.notNull()
.references(() => orgs.orgId),
role: text("role").notNull(), // e.g., 'admin', 'member', etc.
});
// Define the model types for type inference
export type Org = InferSelectModel<typeof orgs>;
export type User = InferSelectModel<typeof users>;