auth.module.ts 804 B

1234567891011121314151617181920212223
  1. import { Module } from '@nestjs/common'
  2. import { JwtModule } from '@nestjs/jwt'
  3. import { PassportModule } from '@nestjs/passport'
  4. import { AuthController } from './auth.controller'
  5. import { AuthService } from './auth.service'
  6. import { JwtStrategy } from './strategies/jwt.strategy'
  7. import { GoogleStrategy } from './strategies/google.strategy'
  8. import { OrgsModule } from '../orgs/orgs.module'
  9. @Module({
  10. imports: [
  11. PassportModule.register({ defaultStrategy: 'jwt' }),
  12. JwtModule.register({
  13. secret: process.env['JWT_SECRET'] || 'dev-secret-change-in-production',
  14. signOptions: { expiresIn: '15m' },
  15. }),
  16. OrgsModule,
  17. ],
  18. controllers: [AuthController],
  19. providers: [AuthService, JwtStrategy, GoogleStrategy],
  20. exports: [AuthService, JwtModule],
  21. })
  22. export class AuthModule {}