* chore: enable apiv2 auth with api keys * chore: enable apiv2 auth with api keys * chore: enable apiv2 auth with api keys * chore: enable apiv2 auth with api keys * chore: enable apiv2 auth with api keys * fixup! chore: enable apiv2 auth with api keys * fixup! Merge branch 'chore-apiv2-auth-api-key' of github.com:calcom/cal.com into chore-apiv2-auth-api-key * fixup! fixup! Merge branch 'chore-apiv2-auth-api-key' of github.com:calcom/cal.com into chore-apiv2-auth-api-key * fixup! fixup! fixup! Merge branch 'chore-apiv2-auth-api-key' of github.com:calcom/cal.com into chore-apiv2-auth-api-key
17 lines
504 B
TypeScript
17 lines
504 B
TypeScript
import { PrismaReadService } from "@/modules/prisma/prisma-read.service";
|
|
import { PrismaWriteService } from "@/modules/prisma/prisma-write.service";
|
|
import { Injectable } from "@nestjs/common";
|
|
|
|
@Injectable()
|
|
export class ApiKeyRepository {
|
|
constructor(private readonly dbRead: PrismaReadService, private readonly dbWrite: PrismaWriteService) {}
|
|
|
|
async getApiKeyFromHash(hashedKey: string) {
|
|
return this.dbRead.prisma.apiKey.findUnique({
|
|
where: {
|
|
hashedKey,
|
|
},
|
|
});
|
|
}
|
|
}
|