Add Better Auth admin authentication
This commit is contained in:
17
convex/betterAuth/adapter.ts
Normal file
17
convex/betterAuth/adapter.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { createApi } from "@convex-dev/better-auth";
|
||||
|
||||
import { createAuthOptions } from "./auth.js";
|
||||
import schema from "./schema.js";
|
||||
|
||||
const createSchemaAuthOptions = (ctx: Parameters<typeof createAuthOptions>[0]) =>
|
||||
createAuthOptions(ctx, { allowMissingSecret: true });
|
||||
|
||||
export const {
|
||||
create,
|
||||
findOne,
|
||||
findMany,
|
||||
updateOne,
|
||||
updateMany,
|
||||
deleteOne,
|
||||
deleteMany,
|
||||
} = createApi(schema, createSchemaAuthOptions);
|
||||
Reference in New Issue
Block a user