Spaces:
Sleeping
Sleeping
File size: 1,284 Bytes
8a24f2c aa95439 6f49b87 b4d141a ec9da6a a0eafe5 8a24f2c aa95439 6f49b87 aa95439 b4d141a a0eafe5 aa95439 6f49b87 a0eafe5 6f49b87 aa95439 8a24f2c ec9da6a aa95439 8a24f2c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | import { Module } from '@nestjs/common';
import { AuthService } from './auth.service';
import { AuthController } from './auth.controller';
import { UsersModule } from '../users/users.module';
import { JwtModule } from '@nestjs/jwt';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { PassportModule } from '@nestjs/passport';
import { JwtStrategy } from './jwt.strategy';
import { MailModule } from '../mail/mail.model'
import { GoogleStrategy } from './strategies/google.strategy';
import { ScraperModule } from '../scraper/scraper.module';
@Module({
imports: [
UsersModule,
PassportModule,
ConfigModule,
MailModule,
// Login refreshes a stale feed on the way in (see ScraperService.ensureFreshFeed).
ScraperModule,
JwtModule.registerAsync({
imports: [ConfigModule],
inject: [ConfigService],
useFactory: (config: ConfigService) => ({
secret: config.get<string>('JWT_ACCESS_SECRET'), // Access token secret
signOptions: {
expiresIn: config.get<number>('JWT_ACCESS_TTL') || 3600,
},
}),
}),
],
controllers: [AuthController],
providers: [AuthService, JwtStrategy, GoogleStrategy], // ⬅️ Add JwtStrategy here
exports: [AuthService],
})
export class AuthModule {}
|