feat: implement authentication flow and dynamic API configuration #5
This commit is contained in:
@@ -1,16 +1,19 @@
|
||||
import { HTTP_INTERCEPTORS } from '@angular/common/http';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { APP_INITIALIZER, Component, inject, OnInit, provideAppInitializer } from '@angular/core';
|
||||
import { Router, RouterOutlet } from '@angular/router';
|
||||
import { DefaultOAuthInterceptor, OAuthService } from 'angular-oauth2-oidc';
|
||||
import { AppConfigService } from './services/config.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
imports: [RouterOutlet],
|
||||
providers: [OAuthService, {
|
||||
provide: HTTP_INTERCEPTORS,
|
||||
useClass: DefaultOAuthInterceptor,
|
||||
multi: true,
|
||||
}],
|
||||
providers: [
|
||||
OAuthService,
|
||||
{
|
||||
provide: HTTP_INTERCEPTORS,
|
||||
useClass: DefaultOAuthInterceptor,
|
||||
multi: true,
|
||||
}],
|
||||
templateUrl: './app.html',
|
||||
styleUrl: './app.scss'
|
||||
})
|
||||
@@ -28,6 +31,6 @@ export class App implements OnInit {
|
||||
});
|
||||
}
|
||||
ngOnInit(): void {
|
||||
this.as.loadDiscoveryDocumentAndLogin();
|
||||
this.as.loadDiscoveryDocumentAndLogin().then(() => this.router.navigate(['login']));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user