28 lines
733 B
TypeScript
28 lines
733 B
TypeScript
import { Module } from '@nestjs/common';
|
|
import { JwtModule } from '@nestjs/jwt';
|
|
import { PassportModule } from '@nestjs/passport';
|
|
import { AuthService } from './auth.service';
|
|
import { AuthController } from './auth.controller';
|
|
import { JwtStrategy } from './jwt.strategy';
|
|
import { UsersModule } from '../users/users.module';
|
|
import * as dotenv from 'dotenv';
|
|
|
|
dotenv.config();
|
|
|
|
@Module({
|
|
imports: [
|
|
UsersModule,
|
|
PassportModule,
|
|
JwtModule.register({
|
|
secret: process.env.JWT_SECRET || 'your-secret-key-here',
|
|
signOptions: {
|
|
expiresIn: '3600s',
|
|
},
|
|
}),
|
|
],
|
|
providers: [AuthService, JwtStrategy],
|
|
controllers: [AuthController],
|
|
exports: [AuthService],
|
|
})
|
|
export class AuthModule {}
|