Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: handle errors when auto logging in

thecodrr7a3b11a42df0
diff --git a/apps/web/src/components/dialogs/logindialog.js b/apps/web/src/components/dialogs/logindialog.js
index 2257fcaca..bb5838c9b 100644
--- a/apps/web/src/components/dialogs/logindialog.js
+++ b/apps/web/src/components/dialogs/logindialog.js
@@ -28,12 +28,18 @@ function LoginDialog(props) {
if (!credential.password) {
setUsername(credential.id);
} else {
- await login({
- password: credential.password,
- username: credential.id,
- remember: true,
- });
- onClose();
+ try {
+ await login({
+ password: credential.password,
+ username: credential.id,
+ remember: true,
+ });
+ onClose();
+ } catch (e) {
+ setUsername(credential.id);
+ setCredential();
+ setError(e.message);
+ }
}
}
})();