create use cases for auth

This commit is contained in:
andres
2023-06-15 23:10:07 +02:00
parent 612b2326f9
commit 131fec67de
20 changed files with 315 additions and 239 deletions

View File

@@ -0,0 +1,18 @@
import { Injectable } from '@nestjs/common'
import { PrismaService } from '../../../prisma.service'
@Injectable()
export class AuthRepository {
constructor(private prisma: PrismaService) {}
async createRefreshToken(userId: string, token: string, expiresAt: Date) {
return await this.prisma.refreshToken.create({
data: {
userId,
token,
expiresAt,
isRevoked: false,
},
})
}
}