diff --git a/Web/src/app/app.component.ts b/Web/src/app/app.component.ts index 739c4cb..d1dd17e 100755 --- a/Web/src/app/app.component.ts +++ b/Web/src/app/app.component.ts @@ -1,5 +1,5 @@ import { Component } from '@angular/core'; -import { RouterOutlet } from '@angular/router'; +import { Router, RouterOutlet } from '@angular/router'; import { OAuthService } from 'angular-oauth2-oidc'; @Component({ @@ -12,4 +12,16 @@ import { OAuthService } from 'angular-oauth2-oidc'; }) export class AppComponent { title = 'Digitálny asistent PAS'; + constructor(private readonly as: OAuthService, private readonly router: Router) { + this.as.configure({ + issuer: 'https://accounts.google.com', + redirectUri: window.location.origin + '/login', + clientId: '1000025801082-09ikmt61a9c9vbdjhpdab9b0ui3vdnij.apps.googleusercontent.com', + dummyClientSecret: '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', + scope: 'openid profile email', + responseType: 'code', + strictDiscoveryDocumentValidation: false, + timeoutFactor: 0.01, + }); + } } diff --git a/Web/src/app/app.config.ts b/Web/src/app/app.config.ts index 702af07..4f1c811 100755 --- a/Web/src/app/app.config.ts +++ b/Web/src/app/app.config.ts @@ -38,6 +38,7 @@ import { adapterFactory } from 'angular-calendar/date-adapters/date-fns'; // code view import { provideHighlightOptions } from 'ngx-highlightjs'; import 'highlight.js/styles/atom-one-dark.min.css'; +import { OAuthModule, provideOAuthClient } from 'angular-oauth2-oidc'; export function HttpLoaderFactory(http: HttpClient): any { return new TranslateHttpLoader(http, './assets/i18n/', '.json'); @@ -66,6 +67,13 @@ export const appConfig: ApplicationConfig = { withComponentInputBinding() ), provideHttpClient(withInterceptorsFromDi()), + provideOAuthClient({ + resourceServer: { + allowedUrls: ['http://localhost:5000', 'https://localhost:4200', 'https://centrum.lesko.me', 'https://beta.e-dias.sk/'], + sendAccessToken: true, + }, + }), + provideClientHydration(), provideAnimationsAsync(), importProvidersFrom( diff --git a/Web/src/app/pages/authentication/side-login/side-login.component.html b/Web/src/app/pages/authentication/side-login/side-login.component.html index 6294343..21c56a2 100755 --- a/Web/src/app/pages/authentication/side-login/side-login.component.html +++ b/Web/src/app/pages/authentication/side-login/side-login.component.html @@ -17,12 +17,12 @@ Váš uživateľský prístup
- +