mirror of
https://github.com/ershisan99/flashcards-api.git
synced 2025-12-27 12:34:10 +00:00
create use cases for auth
This commit is contained in:
18
src/modules/auth/infrastructure/auth.repository.ts
Normal file
18
src/modules/auth/infrastructure/auth.repository.ts
Normal 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,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user