Temporarily fixes CORS header issue while logging in
This commit is contained in:
parent
2e8830b9d3
commit
d9e27bfaf1
1 changed files with 6 additions and 1 deletions
|
@ -3,7 +3,12 @@ import cons from '../state/cons';
|
||||||
import { getBaseUrl } from '../../util/matrixUtil';
|
import { getBaseUrl } from '../../util/matrixUtil';
|
||||||
|
|
||||||
async function login(username, homeserver, password) {
|
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');
|
if (typeof baseUrl === 'undefined') throw new Error('Homeserver not found');
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue