Inicio de home y Angular Material
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user