import { Injectable } from '@nestjs/common';
import { Repository } from 'typeorm';
import { InjectRepository } from '@nestjs/typeorm';
import { JwtService } from '@nestjs/jwt';
import { AuthenticationMiddleware } from '../authentication.middleware';
import { User } from '@/entities/user.entity';
import { UserAuthService } from '../../services/implements/user-auth.service';

@Injectable()
export class UserAuthMiddleware extends AuthenticationMiddleware<User> {
  constructor(
    readonly jwtService: JwtService,
    @InjectRepository(User)
    readonly userRepo: Repository<User>,
    readonly authService: UserAuthService,
  ) {
    super(jwtService, userRepo, authService);
  }
}
