Inicio de home y Angular Material

This commit is contained in:
Eneko Nieto
2021-01-21 01:14:17 +01:00
parent 7c2bc6a3dc
commit d133876325
21 changed files with 192 additions and 119 deletions

View File

@@ -2,12 +2,12 @@ import { Component } from '@angular/core';
import { OAuthService, NullValidationHandler } from 'angular-oauth2-oidc';
import { Router } from '@angular/router';
import { filter } from 'rxjs/operators';
import { authCodeFlowConfig } from './auth-code-flow.config';
import { authConfig } from './auth.config';
import { useHash } from '../flags';
@Component({
// tslint:disable-next-line:component-selector
selector: 'flight-app',
selector: 'app-root',
templateUrl: './app.component.html',
})
export class AppComponent {
@@ -24,7 +24,7 @@ export class AppComponent {
}
private configureCodeFlow(): void {
this.oauthService.configure(authCodeFlowConfig);
this.oauthService.configure(authConfig);
this.oauthService.loadDiscoveryDocumentAndTryLogin().then((_) => {
if (useHash) {
this.router.navigate(['/']);
@@ -32,6 +32,8 @@ export class AppComponent {
});
// Optional
this.oauthService.setupAutomaticSilentRefresh();
if (authConfig.useSilentRefresh) {
this.oauthService.setupAutomaticSilentRefresh();
}
}
}