Add verify middleware

This commit is contained in:
Owen Schwartz 2024-10-03 22:31:20 -04:00
parent e89ee4042a
commit a8f944fc78
No known key found for this signature in database
GPG key ID: 8271FDFFD9E0CCBD
17 changed files with 1230 additions and 40 deletions

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>;