added post key route

This commit is contained in:
daniel31x13
2024-01-13 01:20:06 -05:00
parent 834d25a99e
commit d91ebb3fa2
13 changed files with 417 additions and 83 deletions
+22
View File
@@ -0,0 +1,22 @@
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,
};
}