ConusAI vendor v0.1.0-dev.20261027+9b1131fb
ci / gate (push) Waiting to run

This commit is contained in:
ConusAI vendor v0.1.0-dev.20261027+9b1131fb
2026-10-27 18:05:17 +00:00
commit 3102273ec7
538 changed files with 80203 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
// SPDX-License-Identifier: LicenseRef-ConusAI-Template-1.0
// What the app server asks of this deployment (@conusai-kit/auth-convex-better-auth):
//
// validateSession the session check of every request, under the token Better Auth issued for
// the request's own session cookie (public: a token is the only way in)
// pendingRevocations the revocation outbox, drained by the relay with the deployment's admin key
// settleRevocation (internal: only the admin key reaches them)
// endAccount the app's own account deletion ends the person's Better Auth account first
// (internal), through Better Auth itself, so the component triggers record it
import { defineBetterAuthSessionApi } from "@conusai-kit/auth-convex-better-auth/convex"
import { v } from "convex/values"
import { components } from "./_generated/api"
import { internalMutation } from "./_generated/server"
import { authComponent, createAuth } from "./auth"
export const { validateSession, pendingRevocations, settleRevocation } = defineBetterAuthSessionApi({
authComponent,
component: components.betterAuth,
})
export const endAccount = internalMutation({
args: { userId: v.string() },
returns: v.null(),
handler: async (ctx, { userId }) => {
const auth = await createAuth(ctx).$context
if (!(await auth.internalAdapter.findUserById(userId))) return null
// Its sessions, accounts and the user, each through the component, so every trigger records it.
await auth.internalAdapter.deleteUser(userId)
return null
},
})