<%_ if (authenticationType === 'oauth2') { _%>
import { HttpModule } from '@nestjs/axios';
<%_ } _%>
import { Module } from '@nestjs/common';
import { AuthService } from '../service/auth.service';
import { UserModule } from '../module/user.module';
import { PassportModule } from '@nestjs/passport';
<%_ if (authenticationType === 'jwt') { _%>
import { JwtModule } from '@nestjs/jwt';
import { JwtStrategy } from '../security/passport.jwt.strategy';
import { UserJWTController} from '../web/rest/user.jwt.controller';
<%_ } else if (authenticationType === 'oauth2') { _%>
import { Oauth2Strategy } from '../security/passport.oauth2.strategy';
import { UserOauth2Controller } from '../web/rest/user.oauth2.controller';
<%_ } _%>
<%_ if (authenticationType === 'jwt') { _%>
import { config } from '../config';
<%_ } _%>
import { TypeOrmModule } from '@nestjs/typeorm';
import { Authority } from '../domain/authority.entity';

import { PublicUserController } from '../web/rest/public.user.controller';
import { AccountController } from '../web/rest/account.controller';

@Module({
  imports: [TypeOrmModule.forFeature([Authority]),
  UserModule,
  PassportModule,
  <%_ if (authenticationType === 'jwt') { _%>
    JwtModule.register({
      secret: config['jhipster.security.authentication.jwt.base64-secret'],
      signOptions: { expiresIn: '300s' },
    }),
  <%_ } else if (authenticationType === 'oauth2') { _%>
  HttpModule,
  <%_ } _%>
  ],
  controllers: [
  <%_ if (authenticationType === 'jwt') { _%>
  UserJWTController,
  <%_ } else if (authenticationType === 'oauth2') { _%>
  UserOauth2Controller,
  <%_ } _%>
  PublicUserController, AccountController ],
  providers: [AuthService,
  <%_ if (authenticationType === 'jwt') { _%>
  JwtStrategy
  <%_ } else if (authenticationType === 'oauth2') { _%>
  Oauth2Strategy
  <%_ } _%>
  ],
  exports: [AuthService],
})
export class AuthModule {}
