import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { Friendship } from 'src/friendship/entities/friendship.entity';
import { FriendshipService } from 'src/friendship/friendship.service';
import { User } from 'src/users/entities/user.entity';
import { UsersModule } from 'src/users/users.module';
import { UsersService } from 'src/users/users.service';
import { AuthenticationController } from './authentication.controller';
import { AuthenticationService } from './authentication.service';
import { FortyTwoStrategy } from './strategy/42strategy';
import { SessionSerializer } from './utils/serializer';

@Module({
	  imports: [TypeOrmModule.forFeature([User, Friendship]), UsersModule,
	//   JwtModule.registerAsync({
	// 	useFactory: async (configService: ConfigService) => {
	// 		return {
	// 		  signOptions: { expiresIn: '1h' },
	// 		  secret: process.env.JWT_SECRET,
	// 		};
	// 	}
	// })
	],
	  providers: [AuthenticationService, FortyTwoStrategy, UsersService, SessionSerializer, FriendshipService
	// JwtStrategy
],
	  exports: [AuthenticationService],
	  controllers: [AuthenticationController],
})
export class AuthenticationModule {}
