Minor fixes #5

This commit is contained in:
Marek Lesko
2025-08-01 08:38:44 +02:00
parent 0ab0402172
commit 2f86edb5e6
3 changed files with 11 additions and 10 deletions

2
.vscode/launch.json vendored
View File

@@ -9,7 +9,7 @@
"request": "launch", "request": "launch",
"name": "Launch Chrome against localhost", "name": "Launch Chrome against localhost",
"url": "http://localhost:4200", "url": "http://localhost:4200",
"webRoot": "${workspaceFolder}" "webRoot": "${workspaceFolder}/Web"
} }
] ]
} }

View File

@@ -2,8 +2,8 @@ import { ApplicationConfig, inject, provideAppInitializer, provideBrowserGlobalE
import { provideRouter } from '@angular/router'; import { provideRouter } from '@angular/router';
import { routes } from './app.routes'; import { routes } from './app.routes';
import { provideHttpClient } from '@angular/common/http'; import { HTTP_INTERCEPTORS, provideHttpClient } from '@angular/common/http';
import { provideOAuthClient } from 'angular-oauth2-oidc'; import { DefaultOAuthInterceptor, provideOAuthClient } from 'angular-oauth2-oidc';
import { AppConfigService } from './services/config.service'; import { AppConfigService } from './services/config.service';
export const appConfig: ApplicationConfig = { export const appConfig: ApplicationConfig = {
@@ -15,9 +15,14 @@ export const appConfig: ApplicationConfig = {
provideHttpClient(), provideHttpClient(),
provideOAuthClient({ provideOAuthClient({
resourceServer: { resourceServer: {
allowedUrls: ['http://localhost:5000'], allowedUrls: ['http://localhost:5000', 'https://localhost:5001', 'https://centrum.lesko.me'],
sendAccessToken: true, sendAccessToken: true,
}, },
}) }),
{
provide: HTTP_INTERCEPTORS,
useClass: DefaultOAuthInterceptor,
multi: true,
}
] ]
}; };

View File

@@ -9,11 +9,7 @@ import { AppConfigService } from './services/config.service';
imports: [RouterOutlet], imports: [RouterOutlet],
providers: [ providers: [
OAuthService, OAuthService,
{ ],
provide: HTTP_INTERCEPTORS,
useClass: DefaultOAuthInterceptor,
multi: true,
}],
templateUrl: './app.html', templateUrl: './app.html',
styleUrl: './app.scss' styleUrl: './app.scss'
}) })