Skip to content

Commit c9075b3

Browse files
authored
Only pass id_server if we had one to begin with (#4200)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
1 parent 69c474d commit c9075b3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/interactive-auth.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,10 @@ export class InteractiveAuth<T> {
343343
sid: this.emailSid,
344344
client_secret: this.clientSecret,
345345
};
346-
const idServerParsedUrl = new URL(this.matrixClient.getIdentityServerUrl()!);
347-
creds.id_server = idServerParsedUrl.host;
346+
const isUrl = this.matrixClient.getIdentityServerUrl();
347+
if (isUrl) {
348+
creds.id_server = new URL(isUrl).host;
349+
}
348350
authDict = {
349351
type: EMAIL_STAGE_TYPE,
350352
// TODO: Remove `threepid_creds` once servers support proper UIA

0 commit comments

Comments
 (0)