From c9075b3dba8b2124a3d236bd88949ab440fe04d7 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 15 May 2024 11:59:42 +0100 Subject: [PATCH] Only pass id_server if we had one to begin with (#4200) Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/interactive-auth.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/interactive-auth.ts b/src/interactive-auth.ts index 3e5b8d47e..8b6a686d8 100644 --- a/src/interactive-auth.ts +++ b/src/interactive-auth.ts @@ -343,8 +343,10 @@ export class InteractiveAuth { sid: this.emailSid, client_secret: this.clientSecret, }; - const idServerParsedUrl = new URL(this.matrixClient.getIdentityServerUrl()!); - creds.id_server = idServerParsedUrl.host; + const isUrl = this.matrixClient.getIdentityServerUrl(); + if (isUrl) { + creds.id_server = new URL(isUrl).host; + } authDict = { type: EMAIL_STAGE_TYPE, // TODO: Remove `threepid_creds` once servers support proper UIA