Skip to content

Scheduling infrastructure for absolutely everyone.

fix browser extension redirect (#25885)

Carina Wollendorfer18415e35a7d4
diff --git a/companion/services/oauthService.ts b/companion/services/oauthService.ts
index 28db8bb6ed2..2f15fce4bfa 100644
--- a/companion/services/oauthService.ts
+++ b/companion/services/oauthService.ts
@@ -132,33 +132,13 @@ export class CalComOAuthService {
}
return { type: "error" };
- }
-
- if (Platform.OS === "web") {
- const discovery = await this.getDiscoveryEndpoints();
- const request = new AuthSession.AuthRequest({
- clientId: this.config.clientId,
- redirectUri: this.config.redirectUri,
- responseType: AuthSession.ResponseType.Code,
- state,
- codeChallenge,
- codeChallengeMethod: AuthSession.CodeChallengeMethod.S256,
- });
-
- const result = await request.promptAsync(discovery);
-
- if (result.type === "success") {
- return { type: "success", params: result.params ?? {} };
+ } else {
+ try {
+ const responseUrl = await this.launchExtensionAuthFlow(authUrl);
+ return { type: "success", params: this.parseCallbackUrl(responseUrl) };
+ } catch {
+ return { type: "error" };
}
-
- return { type: "error" };
- }
-
- try {
- const responseUrl = await this.launchExtensionAuthFlow(authUrl);
- return { type: "success", params: this.parseCallbackUrl(responseUrl) };
- } catch {
- return { type: "error" };
}
}