From cfe8d9265a7b92326b09a7c22b54eaf467b129d6 Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Mon, 8 May 2023 09:37:07 +0200 Subject: [PATCH] [PM-2014] feat: add new auth and auth core modules --- apps/web/src/app/app.module.ts | 2 ++ apps/web/src/app/auth/auth.module.ts | 11 +++++++++++ apps/web/src/app/auth/core/core.module.ts | 10 ++++++++++ apps/web/src/app/auth/index.ts | 1 + 4 files changed, 24 insertions(+) create mode 100644 apps/web/src/app/auth/auth.module.ts create mode 100644 apps/web/src/app/auth/core/core.module.ts create mode 100644 apps/web/src/app/auth/index.ts diff --git a/apps/web/src/app/app.module.ts b/apps/web/src/app/app.module.ts index 5d1afd2122..54e96a8814 100644 --- a/apps/web/src/app/app.module.ts +++ b/apps/web/src/app/app.module.ts @@ -6,6 +6,7 @@ import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; import { InfiniteScrollModule } from "ngx-infinite-scroll"; import { AppComponent } from "./app.component"; +import { AuthModule } from "./auth"; import { CoreModule } from "./core"; import { OssRoutingModule } from "./oss-routing.module"; import { OssModule } from "./oss.module"; @@ -13,6 +14,7 @@ import { WildcardRoutingModule } from "./wildcard-routing.module"; @NgModule({ imports: [ + AuthModule, OssModule, BrowserAnimationsModule, FormsModule, diff --git a/apps/web/src/app/auth/auth.module.ts b/apps/web/src/app/auth/auth.module.ts new file mode 100644 index 0000000000..f154175e40 --- /dev/null +++ b/apps/web/src/app/auth/auth.module.ts @@ -0,0 +1,11 @@ +import { NgModule } from "@angular/core"; + +import { CoreAuthModule } from "./core/core.module"; + +@NgModule({ + imports: [CoreAuthModule], + declarations: [], + providers: [], + exports: [], +}) +export class AuthModule {} diff --git a/apps/web/src/app/auth/core/core.module.ts b/apps/web/src/app/auth/core/core.module.ts new file mode 100644 index 0000000000..7fdfa6f51b --- /dev/null +++ b/apps/web/src/app/auth/core/core.module.ts @@ -0,0 +1,10 @@ +import { NgModule, Optional, SkipSelf } from "@angular/core"; + +@NgModule({}) +export class CoreAuthModule { + constructor(@Optional() @SkipSelf() parentModule?: CoreAuthModule) { + if (parentModule) { + throw new Error("CoreAuthModule is already loaded. Import it in AuthModule only"); + } + } +} diff --git a/apps/web/src/app/auth/index.ts b/apps/web/src/app/auth/index.ts new file mode 100644 index 0000000000..1dced9682f --- /dev/null +++ b/apps/web/src/app/auth/index.ts @@ -0,0 +1 @@ +export * from "./auth.module";