feat: add global auth settings and pending users
This commit is contained in:
@@ -24,6 +24,21 @@ export const incidentStatusEnum = pgEnum("incident_status", ["open", "acknowledg
|
||||
export const incidentSeverityEnum = pgEnum("incident_severity", ["info", "warning", "critical"]);
|
||||
export const joinRequestStatusEnum = pgEnum("join_request_status", ["pending", "approved", "rejected"]);
|
||||
|
||||
export const systemSettings = pgTable("system_settings", {
|
||||
id: text("id").primaryKey().default("global"),
|
||||
registrationEnabled: boolean("registration_enabled").notNull().default(true),
|
||||
oidcEnabled: boolean("oidc_enabled").notNull().default(false),
|
||||
oidcIssuerUrl: text("oidc_issuer_url").notNull().default(""),
|
||||
oidcClientId: text("oidc_client_id").notNull().default(""),
|
||||
oidcClientSecret: text("oidc_client_secret").notNull().default(""),
|
||||
oidcScopes: text("oidc_scopes").notNull().default("openid profile email"),
|
||||
oidcRedirectUri: text("oidc_redirect_uri").notNull().default(""),
|
||||
oidcAvatarClaim: text("oidc_avatar_claim").notNull().default("picture"),
|
||||
oidcAutoProvision: boolean("oidc_auto_provision").notNull().default(false),
|
||||
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
||||
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
||||
});
|
||||
|
||||
export const organizations = pgTable("organizations", {
|
||||
id: uuid("id").primaryKey().defaultRandom(),
|
||||
name: text("name").notNull(),
|
||||
@@ -36,6 +51,7 @@ export const organizations = pgTable("organizations", {
|
||||
oidcClientSecret: text("oidc_client_secret").notNull().default(""),
|
||||
oidcScopes: text("oidc_scopes").notNull().default("openid profile email"),
|
||||
oidcRedirectUri: text("oidc_redirect_uri").notNull().default(""),
|
||||
oidcAvatarClaim: text("oidc_avatar_claim").notNull().default("picture"),
|
||||
oidcAutoProvision: boolean("oidc_auto_provision").notNull().default(false),
|
||||
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
||||
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
||||
@@ -79,6 +95,7 @@ export const accounts = pgTable("accounts", {
|
||||
platformRoleId: uuid("platform_role_id").references(() => roles.id),
|
||||
name: text("name").notNull(),
|
||||
email: text("email").notNull(),
|
||||
avatarUrl: text("avatar_url").notNull().default(""),
|
||||
passwordHash: text("password_hash").notNull(),
|
||||
passwordSalt: text("password_salt").notNull(),
|
||||
status: accountStatusEnum("status").notNull().default("active"),
|
||||
|
||||
Reference in New Issue
Block a user