From d9e27bfaf1a13f92220362edb7fe2f896e08aac9 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Jul 2021 13:53:50 +0530 Subject: [PATCH] Temporarily fixes CORS header issue while logging in --- src/client/action/auth.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/client/action/auth.js b/src/client/action/auth.js index 170fb4b7..0403ec9f 100644 --- a/src/client/action/auth.js +++ b/src/client/action/auth.js @@ -3,7 +3,12 @@ import cons from '../state/cons'; import { getBaseUrl } from '../../util/matrixUtil'; async function login(username, homeserver, password) { - const baseUrl = await getBaseUrl(homeserver); + let baseUrl = null; + try { + baseUrl = await getBaseUrl(homeserver); + } catch (e) { + baseUrl = `https://${homeserver}`; + } if (typeof baseUrl === 'undefined') throw new Error('Homeserver not found');