diff --git a/.vscode/launch.json b/.vscode/launch.json index 1348ba4..fb4d3f0 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,7 +9,7 @@ "request": "launch", "name": "Launch Chrome against localhost", "url": "http://localhost:4200", - "webRoot": "${workspaceFolder}" + "webRoot": "${workspaceFolder}/Web" } ] } \ No newline at end of file diff --git a/Web/src/app/app.config.ts b/Web/src/app/app.config.ts index 3f08b26..6827d46 100644 --- a/Web/src/app/app.config.ts +++ b/Web/src/app/app.config.ts @@ -2,8 +2,8 @@ import { ApplicationConfig, inject, provideAppInitializer, provideBrowserGlobalE import { provideRouter } from '@angular/router'; import { routes } from './app.routes'; -import { provideHttpClient } from '@angular/common/http'; -import { provideOAuthClient } from 'angular-oauth2-oidc'; +import { HTTP_INTERCEPTORS, provideHttpClient } from '@angular/common/http'; +import { DefaultOAuthInterceptor, provideOAuthClient } from 'angular-oauth2-oidc'; import { AppConfigService } from './services/config.service'; export const appConfig: ApplicationConfig = { @@ -15,9 +15,14 @@ export const appConfig: ApplicationConfig = { provideHttpClient(), provideOAuthClient({ resourceServer: { - allowedUrls: ['http://localhost:5000'], + allowedUrls: ['http://localhost:5000', 'https://localhost:5001', 'https://centrum.lesko.me'], sendAccessToken: true, }, - }) + }), + { + provide: HTTP_INTERCEPTORS, + useClass: DefaultOAuthInterceptor, + multi: true, + } ] }; diff --git a/Web/src/app/app.ts b/Web/src/app/app.ts index fc01e6e..fb52337 100644 --- a/Web/src/app/app.ts +++ b/Web/src/app/app.ts @@ -9,11 +9,7 @@ import { AppConfigService } from './services/config.service'; imports: [RouterOutlet], providers: [ OAuthService, - { - provide: HTTP_INTERCEPTORS, - useClass: DefaultOAuthInterceptor, - multi: true, - }], + ], templateUrl: './app.html', styleUrl: './app.scss' })