feat[convex]: api key auth support

This commit is contained in:
2025-10-20 00:17:41 +00:00
parent a4544a3f09
commit d0893e13be
7 changed files with 80 additions and 6 deletions

14
packages/convex/apikey.ts Normal file
View File

@@ -0,0 +1,14 @@
import { verifyApiKey as _verifyApiKey, parseApiKey } from "@drexa/auth"
import { WebCryptoSha256Hasher } from "@drexa/auth/hasher"
import { v } from "convex/values"
import { query } from "./_generated/server"
import * as ApiKey from "./model/apikey"
export const verifyApiKey = query({
args: {
unhashedKey: v.string(),
},
handler: async (ctx, args) => {
return await ApiKey.verifyApiKey(ctx, args.unhashedKey)
},
})