fix: refactor two commands in saving grade to prevent race conditions

This commit is contained in:
2024-01-20 13:13:59 +01:00
parent b897c775a9
commit 6b63fd498a
14 changed files with 140 additions and 97 deletions

View File

@@ -10,7 +10,10 @@ import { UsersRepository } from '../users/infrastructure/users.repository'
@Injectable()
export class AuthService {
constructor(private usersRepository: UsersRepository, private prisma: PrismaService) {}
constructor(
private usersRepository: UsersRepository,
private prisma: PrismaService
) {}
async createJwtTokensPair(userId: string, rememberMe?: boolean) {
const accessSecretKey = process.env.ACCESS_JWT_SECRET_KEY