diff --git a/src/main.ts b/src/main.ts index d67cfc0..fbb747f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -95,15 +95,15 @@ async function prepareLoginModal(register: boolean) { `)) }) - .catch((err) => { - prepareLoginModal(false) - $('#verification-alert').html(` + .catch((err) => { + prepareLoginModal(false) + $('#verification-alert').html(` `) - }) + }) }) } else { document.querySelector('#loginModalLabel')!.innerText = 'Login to your Apexie ID' @@ -112,10 +112,10 @@ async function prepareLoginModal(register: boolean) { ` + document.getElementById('account-register')!.addEventListener('click', () => prepareLoginModal(true)) } document.querySelector('#account-username-fill')!.hidden = !register document.querySelector('#account-confirm-password-fill')!.hidden = !register - document.getElementById('account-register')!.addEventListener('click', () => prepareLoginModal(true)) document.getElementById('account-login')!.addEventListener('click', async () => { await pb.collection('users').authWithPassword((document.getElementById('account-email')!).value, (document.getElementById('account-password')!).value).catch((err) => { $('#verification-alert').html(` diff --git a/src/pages/redirect.ts b/src/pages/redirect.ts index d6c5d85..9b09191 100644 --- a/src/pages/redirect.ts +++ b/src/pages/redirect.ts @@ -26,7 +26,7 @@ pb.collection('users').authWithOAuth2( } ).then(() => { // document.getElementById('content').innerText = JSON.stringify(authData, null, 2); - new Location().assign('/') + window.location.href = '/' }).catch((err) => { document.getElementById('content')!.innerText = "Failed to exchange code.\n" + err }) \ No newline at end of file