From cb3e15c140272722965bf6cf307b5f898a3dd73b Mon Sep 17 00:00:00 2001 From: myoffice-sync Date: Wed, 5 Aug 2026 15:08:52 +0000 Subject: [PATCH] sync build tree from private myoffice --- MyOffice.SPA/src/app/app.config.ts | 11 +++++++++-- MyOffice.SPA/src/app/core/core.module.ts | 4 +--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/MyOffice.SPA/src/app/app.config.ts b/MyOffice.SPA/src/app/app.config.ts index 4fd0b7f..f04cd15 100644 --- a/MyOffice.SPA/src/app/app.config.ts +++ b/MyOffice.SPA/src/app/app.config.ts @@ -9,12 +9,14 @@ import { TranslateHttpLoader } from '@ngx-translate/http-loader'; import { LoadingBarRouterModule } from '@ngx-loading-bar/router'; import { LoadingBarHttpClientModule } from '@ngx-loading-bar/http-client'; import { NgScrollbarModule } from 'ngx-scrollbar'; +import { SocialAuthService, SocialLoginModule } from '@abacritt/angularx-social-login'; // app import { CoreModule } from './core/core.module'; import { AppRoutingModule } from './app-routing.module'; import { ErrorInterceptor } from './core/interceptor/error.interceptor'; import { UpdateDateHttpInterceptor } from './core/interceptor/update.date.http.interceptor '; +import { ExternalLoginConfig } from './config.external-login'; export function createTranslateLoader(http: HttpClient) { return new TranslateHttpLoader(http, 'assets/i18n/', '.json'); @@ -35,11 +37,16 @@ export const appConfig: ApplicationConfig = { deps: [HttpClient], }, }), - // core & shared CoreModule, + SocialLoginModule, ), + // AuthService is providedIn: 'root' — config must be on the app injector (string token for lib 2.1.x) + { + provide: 'SocialAuthServiceConfig', + useValue: ExternalLoginConfig.getSocialConfig(), + }, + SocialAuthService, { provide: LocationStrategy, useClass: HashLocationStrategy }, - // Bearer tokens: angular-oauth2-oidc resourceServer (AuthModuleConfig.sendAccessToken) { provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true }, { provide: HTTP_INTERCEPTORS, useClass: UpdateDateHttpInterceptor, multi: true }, provideHttpClient(withInterceptorsFromDi()), diff --git a/MyOffice.SPA/src/app/core/core.module.ts b/MyOffice.SPA/src/app/core/core.module.ts index dd2eafb..4289616 100644 --- a/MyOffice.SPA/src/app/core/core.module.ts +++ b/MyOffice.SPA/src/app/core/core.module.ts @@ -7,10 +7,9 @@ import { APP_INITIALIZER } from '@angular/core'; import { CommonModule } from '@angular/common'; // libs +import { AuthModule } from '@auth0/auth0-angular'; import { OAuthModule, OAuthModuleConfig, OAuthStorage } from 'angular-oauth2-oidc'; import { AuthConfig } from 'angular-oauth2-oidc'; -import { AuthModule } from '@auth0/auth0-angular'; -import { SocialLoginModule } from '@abacritt/angularx-social-login'; // app import { AuthGuard } from './guard/auth.guard'; @@ -33,7 +32,6 @@ export function storageFactory(): OAuthStorage { declarations: [], imports: [ CommonModule, - SocialLoginModule.initialize(ExternalLoginConfig.getSocialConfig()), OAuthModule.forRoot(), AuthModule.forRoot(ExternalLoginConfig.getAuth0Config()), ],