el.xwx.moe/lib/api/controllers/tokens/getTokens.ts
2024-01-13 01:20:06 -05:00

23 lines
434 B
TypeScript

import { prisma } from "@/lib/api/db";
import { KeyExpiry } from "@/types/global";
import bcrypt from "bcrypt";
import crypto from "crypto";
export default async function getToken(userId: number) {
const getTokens = await prisma.apiKey.findMany({
where: {
userId,
},
select: {
name: true,
expires: true,
createdAt: true,
},
});
return {
response: getTokens,
status: 200,
};
}