Temporarily fixes CORS header issue while logging in

This commit is contained in:
unknown 2021-07-29 13:53:50 +05:30
parent 2e8830b9d3
commit d9e27bfaf1

View file

@ -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');