Skip to content

Commit 59bd354

Browse files
committed
Handles session protocol error when session domain cannot be parsed
(related to #4146)
1 parent 87a9c29 commit 59bd354

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/plus/integrations/authentication/integrationAuthenticationProvider.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,13 @@ export abstract class CloudIntegrationAuthenticationProvider<
274274

275275
if (!session) return undefined;
276276

277-
const sessionProtocol = new URL(session.domain).protocol;
277+
let sessionProtocol;
278+
try {
279+
sessionProtocol = new URL(session.domain).protocol;
280+
} catch {
281+
// If the domain is invalid, we can't use it to create a session
282+
sessionProtocol = undefined;
283+
}
278284

279285
// TODO: Once we care about domains, we should try to match the domain here against ours, and if it fails, return undefined
280286
return {

0 commit comments

Comments
 (0)