Skip to content

Commit

Permalink
Use registered auth providers instead of declared for getting label, f…
Browse files Browse the repository at this point in the history
…ixes #117463
  • Loading branch information
Rachel Macfarlane committed Feb 23, 2021
1 parent 6fa58b5 commit a5a8392
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export interface IAuthenticationService {

readonly onDidChangeSessions: Event<{ providerId: string, label: string, event: AuthenticationSessionsChangeEvent }>;

// TODO @RMacfarlane completely remove this property
declaredProviders: AuthenticationProviderInformation[];
readonly onDidChangeDeclaredProviders: Event<AuthenticationProviderInformation[]>;

Expand Down Expand Up @@ -661,11 +662,11 @@ export class AuthenticationService extends Disposable implements IAuthentication
}
}
getLabel(id: string): string {
const authProvider = this.declaredProviders.find(provider => provider.id === id);
const authProvider = this._authenticationProviders.get(id);
if (authProvider) {
return authProvider.label;
} else {
throw new Error(`No authentication provider '${id}' has been declared.`);
throw new Error(`No authentication provider '${id}' is currently registered.`);
}
}

Expand Down

0 comments on commit a5a8392

Please sign in to comment.