added post key route
This commit is contained in:
@@ -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,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user