Removed pow, alertModal and fixed storage

This commit is contained in:
Mawoka
2023-05-28 13:03:20 +02:00
parent 0a73c3a811
commit c0bb8ce599
14 changed files with 60 additions and 130 deletions
@@ -37,19 +37,16 @@
try {
data = await res.json();
} catch {
alertModal.set({
open: true,
body: "This shouldn't happen. Please try again.",
title: 'Unknown error'
});
alert("This shouldn't happen");
window.location.reload();
}
if (data.detail === 'wrong credentials') {
alertModal.set({
/* alertModal.set({
open: true,
body: 'Please try again. Your email and or password were incorrect.',
title: 'Wrong Credentials'
});
});*/
alert('Wrong credentials');
}
}
};
@@ -44,19 +44,21 @@
try {
data = await res.json();
} catch {
alertModal.set({
/* alertModal.set({
open: true,
body: "This shouldn't happen. Please try again.",
title: 'Unknown error'
});
});*/
alert('Unknown error');
window.location.reload();
}
if (data.detail === 'totp wrong') {
alertModal.set({
/* alertModal.set({
open: true,
body: 'Wrong Totp-Code. please try again.',
title: 'Totp Error'
});
});*/
alert('TOTP code was incorrect');
totp = '';
}
}
@@ -24,11 +24,12 @@
asseResp = await startAuthentication(data);
} catch (e) {
console.error(e);
alertModal.set({
/* alertModal.set({
open: true,
body: e,
title: 'Unknown error'
});
});*/
alert('Unknown error');
isLoading = false;
}
const res = await fetch(
@@ -51,19 +52,21 @@
try {
data = await res.json();
} catch {
alertModal.set({
/* alertModal.set({
open: true,
body: "This shouldn't happen. Please try again.",
title: 'Unknown error'
});
});*/
alert('Unknown error');
window.location.reload();
}
if (data.detail === 'webauthn failed') {
alertModal.set({
/* alertModal.set({
open: true,
body: 'Webauthn failed. Please try again.',
title: 'Webauthn Error'
});
});*/
alert('Webauthn failed');
}
}
isLoading = false;