summary refs log tree commit diff
path: root/src/connections/BattleNet
diff options
context:
space:
mode:
authorEmma [it/its]@Rory& <root@rory.gay>2023-12-11 01:12:54 +0100
committerEmma [it/its]@Rory& <root@rory.gay>2023-12-11 01:12:54 +0100
commit0a8ceb9e6349284e75545a01ffad608b020f78e2 (patch)
tree17a9163f963eddabf9168b0b630096b2f7535b64 /src/connections/BattleNet
parentPrettier: use editorconfig (diff)
downloadserver-dev/emma-refactors.tar.xz
Actually run prettier dev/emma-refactors
Diffstat (limited to 'src/connections/BattleNet')
-rw-r--r--src/connections/BattleNet/index.ts17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/connections/BattleNet/index.ts b/src/connections/BattleNet/index.ts

index 4fdfccb1..446e0deb 100644 --- a/src/connections/BattleNet/index.ts +++ b/src/connections/BattleNet/index.ts
@@ -47,11 +47,7 @@ export default class BattleNetConnection extends Connection { settings: BattleNetSettings = new BattleNetSettings(); init(): void { - const settings = - ConnectionLoader.getConnectionConfig<BattleNetSettings>( - this.id, - this.settings, - ); + const settings = ConnectionLoader.getConnectionConfig<BattleNetSettings>(this.id, this.settings); if (settings.enabled && (!settings.clientId || !settings.clientSecret)) throw new Error(`Invalid settings for connection ${this.id}`); @@ -73,10 +69,7 @@ export default class BattleNetConnection extends Connection { return this.tokenUrl; } - async exchangeCode( - state: string, - code: string, - ): Promise<ConnectedAccountCommonOAuthTokenResponse> { + async exchangeCode(state: string, code: string): Promise<ConnectedAccountCommonOAuthTokenResponse> { this.validateState(state); const url = this.getTokenUrl(); @@ -92,7 +85,7 @@ export default class BattleNetConnection extends Connection { client_id: this.settings.clientId as string, client_secret: this.settings.clientSecret as string, redirect_uri: this.getRedirectUri(), - }), + }) ) .post() .json<ConnectedAccountCommonOAuthTokenResponse>() @@ -116,9 +109,7 @@ export default class BattleNetConnection extends Connection { }); } - async handleCallback( - params: ConnectionCallbackSchema, - ): Promise<ConnectedAccount | null> { + async handleCallback(params: ConnectionCallbackSchema): Promise<ConnectedAccount | null> { const { state, code } = params; if (!code) throw new Error("No code provided");