mirror of
https://github.com/soconnor0919/beenvoice.git
synced 2026-02-04 15:56:31 -05:00
db: push sso changes
This commit is contained in:
@@ -87,8 +87,8 @@ export function SettingsContent() {
|
||||
const handleLinkAuthentik = async () => {
|
||||
setIsLinking(true);
|
||||
try {
|
||||
await authClient.linkSocial({
|
||||
provider: "authentik",
|
||||
await authClient.signIn.sso({
|
||||
domain: "beenvoice.soconnor.dev",
|
||||
callbackURL: "/dashboard/settings",
|
||||
});
|
||||
} catch (error) {
|
||||
|
||||
@@ -13,6 +13,7 @@ export const auth = betterAuth({
|
||||
session: schema.sessions,
|
||||
account: schema.accounts,
|
||||
verification: schema.verificationTokens,
|
||||
ssoProvider: schema.ssoProviders,
|
||||
},
|
||||
}),
|
||||
trustedOrigins: [
|
||||
@@ -60,6 +61,9 @@ export const auth = betterAuth({
|
||||
jwksEndpoint: "https://auth.soconnor.dev/application/o/beenvoice/jwks/",
|
||||
scopes: ["openid", "email", "profile"],
|
||||
pkce: true,
|
||||
mapping: {
|
||||
emailVerified: "email_verified",
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
@@ -106,6 +106,21 @@ export const verificationTokens = createTable(
|
||||
(t) => [index("verification_token_identifier_idx").on(t.identifier)],
|
||||
);
|
||||
|
||||
export const ssoProviders = createTable(
|
||||
"sso_provider",
|
||||
(d) => ({
|
||||
id: d.varchar({ length: 255 }).notNull().primaryKey().$defaultFn(() => crypto.randomUUID()),
|
||||
providerId: d.varchar({ length: 255 }).notNull().unique(),
|
||||
userId: d.varchar({ length: 255 }).notNull().references(() => users.id),
|
||||
redirectURI: d.varchar({ length: 255 }).notNull().default(""), // Added detailed fields
|
||||
oidcConfig: d.text(),
|
||||
samlConfig: d.text(),
|
||||
createdAt: d.timestamp().notNull().defaultNow(),
|
||||
updatedAt: d.timestamp().notNull().defaultNow().$onUpdate(() => new Date()),
|
||||
}),
|
||||
(t) => [index("sso_provider_user_id_idx").on(t.userId)],
|
||||
);
|
||||
|
||||
// Invoicing app tables
|
||||
export const clients = createTable(
|
||||
"client",
|
||||
|
||||
Reference in New Issue
Block a user