teableio/teable

View on GitHub
apps/nestjs-backend/src/features/plugin/plugin.module.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { Module } from '@nestjs/common';
import { JwtModule } from '@nestjs/jwt';
import { authConfig, type IAuthConfig } from '../../configs/auth.config';
import { AccessTokenModule } from '../access-token/access-token.module';
import { StorageModule } from '../attachments/plugins/storage.module';
import { UserModule } from '../user/user.module';
import { OfficialPluginInitService } from './official/official-plugin-init.service';
import { PluginAuthService } from './plugin-auth.service';
import { PluginController } from './plugin.controller';
import { PluginService } from './plugin.service';

@Module({
  imports: [
    UserModule,
    AccessTokenModule,
    StorageModule,
    JwtModule.registerAsync({
      useFactory: (config: IAuthConfig) => ({
        secret: config.jwt.secret,
        signOptions: {
          expiresIn: config.jwt.expiresIn,
        },
      }),
      inject: [authConfig.KEY],
    }),
  ],
  providers: [PluginService, PluginAuthService, OfficialPluginInitService],
  controllers: [PluginController],
})
export class PluginModule {}