From 1c52ad69a6266208de75fe1e50463ab904e56429 Mon Sep 17 00:00:00 2001 From: Philip Molares Date: Sun, 8 Aug 2021 21:59:23 +0200 Subject: [PATCH] feat: add identity module Signed-off-by: Philip Molares --- src/app.module.ts | 2 ++ src/identity/identity.module.ts | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 src/identity/identity.module.ts diff --git a/src/app.module.ts b/src/app.module.ts index 00add89d1..e3de9d89c 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -25,6 +25,7 @@ import { FrontendConfigModule } from './frontend-config/frontend-config.module'; import { FrontendConfigService } from './frontend-config/frontend-config.service'; import { GroupsModule } from './groups/groups.module'; import { HistoryModule } from './history/history.module'; +import { IdentityModule } from './identity/identity.module'; import { LoggerModule } from './logger/logger.module'; import { MediaModule } from './media/media.module'; import { MonitoringModule } from './monitoring/monitoring.module'; @@ -81,6 +82,7 @@ const routes: Routes = [ MediaModule, AuthModule, FrontendConfigModule, + IdentityModule, ], controllers: [], providers: [FrontendConfigService], diff --git a/src/identity/identity.module.ts b/src/identity/identity.module.ts new file mode 100644 index 000000000..2c5f9a9fa --- /dev/null +++ b/src/identity/identity.module.ts @@ -0,0 +1,28 @@ +/* + * SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file) + * + * SPDX-License-Identifier: AGPL-3.0-only + */ +import { Module } from '@nestjs/common'; +import { PassportModule } from '@nestjs/passport'; +import { TypeOrmModule } from '@nestjs/typeorm'; + +import { LoggerModule } from '../logger/logger.module'; +import { User } from '../users/user.entity'; +import { UsersModule } from '../users/users.module'; +import { Identity } from './identity.entity'; +import { IdentityService } from './identity.service'; +import { LocalStrategy } from './local/local.strategy'; + +@Module({ + imports: [ + TypeOrmModule.forFeature([Identity, User]), + UsersModule, + PassportModule, + LoggerModule, + ], + controllers: [], + providers: [IdentityService, LocalStrategy], + exports: [IdentityService, LocalStrategy], +}) +export class IdentityModule {}