| import { Module } from '@nestjs/common'; | |
| import { AuthController } from './auth.controller'; | |
| import { AuthService } from './auth.service'; | |
| import { PrismaService } from 'prisma/prisma.service'; | |
| import { JwtModule } from '@nestjs/jwt'; | |
| import { PassportModule } from '@nestjs/passport'; | |
| import { JwtStrategy } from './strategies/jwt.strategy'; | |
| ({ | |
| controllers: [AuthController], | |
| providers: [AuthService, PrismaService, JwtStrategy], | |
| // Export section | |
| exports: [JwtStrategy, PassportModule, AuthService], | |
| // Import section | |
| imports: [ | |
| PassportModule.register({ defaultStrategy: 'jwt' }), | |
| JwtModule.register({ | |
| global: true, | |
| secret: process.env.JWT_SECRET, | |
| signOptions: { | |
| expiresIn: '7d', | |
| }, | |
| }), | |
| ], | |
| }) | |
| export class AuthModule {} | |