diff --git a/src/oauth/OAuthApp.ts b/src/oauth/OAuthApp.ts index 13c5315..4c5b342 100644 --- a/src/oauth/OAuthApp.ts +++ b/src/oauth/OAuthApp.ts @@ -98,7 +98,7 @@ type OAuthAppOptions = { addons?: Addon[], }; -export class OAuthApp extends App { +export class OAuthApp extends App { private onAuth: OnAuthCallback; private saveSecret: (secret: string) => void | Promise; @@ -120,7 +120,7 @@ export class OAuthApp extends App { private subscriptionTiers?: AppSubscriptionTier[]; private addons?: Addon[]; - private client: Client; + private client: Client; /** * Create a new OAuth app @@ -197,7 +197,7 @@ export class OAuthApp extends App { } /** Returns the OAuthApp's Client instance (which is useful for managing keys, creating resource request, etc...) */ - getClient(): Client { + getClient(): Client { return this.client; } @@ -229,7 +229,7 @@ export class OAuthApp extends App { .getRouter() .addOutsideFrameworkRoute('/.well-known/jwks.json'); - this.client = await Client.setup( + this.client = await Client.setup( app.getExpressApp(), baseAppUrl, this.onAuth, @@ -240,7 +240,7 @@ export class OAuthApp extends App { subscription_tiers: this.subscriptionTiers, addons: this.addons, webhooks: this.webhooks - }, + } as TCustomClaims, this.appName, this.scopes, { @@ -271,7 +271,7 @@ export class OAuthApp extends App { * * @param app The Express app object (that is now listening) */ - private async onStart(app: App, callback?: (app: OAuthApp) => void | Promise) { + private async onStart(app: App, callback?: (app: OAuthApp) => void | Promise) { try { // Setup the OAuth client. // This is done here because we need the client to be serving/listening for requests for the auth library stuff to work @@ -299,7 +299,7 @@ export class OAuthApp extends App { * And doesn't have to worry about the OAuth details to make this work. * Though it does provide tweaking the OAuth details via options provided to the constructor. */ - async run(initializer?: T, callback?: (app: OAuthApp) => void | Promise) { + async run(initializer?: T, callback?: (app: OAuthApp) => void | Promise) { await super.run(initializer, async (app: App) => this.onStart(app, callback)); } } \ No newline at end of file