Used ts private instead of _ naming convention
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user