summary refs log tree commit diff
path: root/src/connections/BattleNet/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/connections/BattleNet/index.ts')
-rw-r--r--src/connections/BattleNet/index.ts14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/connections/BattleNet/index.ts b/src/connections/BattleNet/index.ts
index 96c3993c..a88633ab 100644
--- a/src/connections/BattleNet/index.ts
+++ b/src/connections/BattleNet/index.ts
@@ -1,5 +1,4 @@
 import {
-	Config,
 	ConnectedAccount,
 	ConnectedAccountCommonOAuthTokenResponse,
 	ConnectionCallbackSchema,
@@ -41,13 +40,7 @@ export default class BattleNetConnection extends Connection {
 		const url = new URL(this.authorizeUrl);
 
 		url.searchParams.append("client_id", this.settings.clientId!);
-		// TODO: probably shouldn't rely on cdn as this could be different from what we actually want. we should have an api endpoint setting.
-		url.searchParams.append(
-			"redirect_uri",
-			`${
-				Config.get().cdn.endpointPrivate || "http://localhost:3001"
-			}/connections/${this.id}/callback`,
-		);
+		url.searchParams.append("redirect_uri", this.getRedirectUri());
 		url.searchParams.append("scope", this.scopes.join(" "));
 		url.searchParams.append("state", state);
 		url.searchParams.append("response_type", "code");
@@ -76,10 +69,7 @@ export default class BattleNetConnection extends Connection {
 					code: code,
 					client_id: this.settings.clientId!,
 					client_secret: this.settings.clientSecret!,
-					redirect_uri: `${
-						Config.get().cdn.endpointPrivate ||
-						"http://localhost:3001"
-					}/connections/${this.id}/callback`,
+					redirect_uri: this.getRedirectUri(),
 				}),
 			)
 			.post()