Skip to main content
Glama
verifications.ts1.07 kB
import { createId } from "@paralleldrive/cuid2"; import { verifications } from "@repo/db/schema"; import { eq } from "drizzle-orm"; import { db } from "../../index"; const generateCode = () => Math.floor(Math.random() * 900000) + 100000 export const verificationsDataAccess = { // 创建验证码,发送魔法链接验证邮箱时使用 create: async (identifier: string, expiresAt: Date) => { const code = generateCode().toString(); const [verification] = await db.insert(verifications).values({ id: createId(), identifier, value: code, expiresAt, }).returning(); return verification; }, // 根据标识符获取验证码 getByIdentifier: async (identifier: string) => { const verification = await db.query.verifications.findFirst({ where: eq(verifications.identifier, identifier), }); return verification; }, getById: async (id: string) => { const verification = await db.query.verifications.findFirst({ where: eq(verifications.id, id), }); return verification; }, }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/metacode0602/open-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server