mirror of
https://github.com/get-drexa/drive.git
synced 2025-11-30 21:41:39 +00:00
feat[convex]: api key auth support
This commit is contained in:
14
packages/convex/apikey.ts
Normal file
14
packages/convex/apikey.ts
Normal 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)
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user