Used ts private instead of _ naming convention

This commit is contained in:
Brian Leathem
2020-11-23 15:23:21 -08:00
parent 78177f24b7
commit cec3da2c90
2 changed files with 6 additions and 6 deletions
@@ -54,7 +54,7 @@ describe('OidcAuthProvider', () => {
.get('/.well-known/openid-configuration')
.reply(200, issuerMetadata);
const provider = new OidcAuthProvider(clientMetadata);
const { strategy } = ((await provider._implementation) as any) as {
const { strategy } = ((await (provider as any).implementation) as any) as {
strategy: {
_client: ClientMetadata;
_issuer: IssuerMetadata;
@@ -54,14 +54,14 @@ export type OidcAuthProviderOptions = OAuthProviderOptions & {
};
export class OidcAuthProvider implements OAuthHandlers {
readonly _implementation: Promise<OidcImpl>;
private readonly implementation: Promise<OidcImpl>;
constructor(options: OidcAuthProviderOptions) {
this._implementation = this.setupStrategy(options);
this.implementation = this.setupStrategy(options);
}
async start(req: OAuthStartRequest): Promise<RedirectInfo> {
const { strategy } = await this._implementation;
const { strategy } = await this.implementation;
return await executeRedirectStrategy(req, strategy, {
accessType: 'offline',
prompt: 'none',
@@ -73,7 +73,7 @@ export class OidcAuthProvider implements OAuthHandlers {
async handler(
req: express.Request,
): Promise<{ response: OAuthResponse; refreshToken: string }> {
const { strategy } = await this._implementation;
const { strategy } = await this.implementation;
const { response, privateInfo } = await executeFrameHandlerStrategy<
OAuthResponse,
PrivateInfo
@@ -86,7 +86,7 @@ export class OidcAuthProvider implements OAuthHandlers {
}
async refresh(req: OAuthRefreshRequest): Promise<OAuthResponse> {
const { client } = await this._implementation;
const { client } = await this.implementation;
const tokenset = await client.refresh(req.refreshToken);
if (!tokenset.access_token) {
throw new Error('Refresh failed');