Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve issue #549: Added return types for OIDC config service. #550

Merged
merged 1 commit into from
Jan 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class OidcConfigService {

constructor(private readonly loggerService: LoggerService, private readonly httpClient: HttpClient) { }

load(configUrl: string) {
load(configUrl: string): Promise<boolean> {
return this.httpClient
.get(configUrl)
.pipe(
Expand All @@ -35,11 +35,11 @@ export class OidcConfigService {
.toPromise();
}

load_using_stsServer(stsServer: string) {
load_using_stsServer(stsServer: string): Promise<boolean> {
return this.loadUsingConfiguration({ stsServer }).toPromise();
}

load_using_custom_stsServer(url: string) {
load_using_custom_stsServer(url: string): Promise<boolean> {
return this.httpClient
.get(url)
.pipe(
Expand All @@ -59,7 +59,7 @@ export class OidcConfigService {
.toPromise();
}

private loadUsingConfiguration(clientConfig: any) {
private loadUsingConfiguration(clientConfig: any): Observable<boolean> {
if (!clientConfig.stsServer) {
this.loggerService.logError(`Property 'stsServer' is not present of passed config ${JSON.stringify(clientConfig)}`, clientConfig);
throw new Error(`Property 'stsServer' is not present of passed config ${JSON.stringify(clientConfig)}`);
Expand Down