Skip to content

Commit 18415e3

Browse files
CarinaWolliCarinaWolli
andauthored
fix browser extension redirect (calcom#25885)
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
1 parent 856792e commit 18415e3

1 file changed

Lines changed: 6 additions & 26 deletions

File tree

companion/services/oauthService.ts

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -132,33 +132,13 @@ export class CalComOAuthService {
132132
}
133133

134134
return { type: "error" };
135-
}
136-
137-
if (Platform.OS === "web") {
138-
const discovery = await this.getDiscoveryEndpoints();
139-
const request = new AuthSession.AuthRequest({
140-
clientId: this.config.clientId,
141-
redirectUri: this.config.redirectUri,
142-
responseType: AuthSession.ResponseType.Code,
143-
state,
144-
codeChallenge,
145-
codeChallengeMethod: AuthSession.CodeChallengeMethod.S256,
146-
});
147-
148-
const result = await request.promptAsync(discovery);
149-
150-
if (result.type === "success") {
151-
return { type: "success", params: result.params ?? {} };
135+
} else {
136+
try {
137+
const responseUrl = await this.launchExtensionAuthFlow(authUrl);
138+
return { type: "success", params: this.parseCallbackUrl(responseUrl) };
139+
} catch {
140+
return { type: "error" };
152141
}
153-
154-
return { type: "error" };
155-
}
156-
157-
try {
158-
const responseUrl = await this.launchExtensionAuthFlow(authUrl);
159-
return { type: "success", params: this.parseCallbackUrl(responseUrl) };
160-
} catch {
161-
return { type: "error" };
162142
}
163143
}
164144

0 commit comments

Comments
 (0)