<template>
<form id="login" @submit.prevent="submit">
+
<!-- login title -->
<div id="loginTitle">
<div>Login</div>
<!-- submit button; position: fixed -->
<button class="submitButton button" type="submit">Submit</button>
+ <div class="invalid" v-if="invalid">
+ Incorrect Credentials
+ </div>
</form>
<!-- back to login button: position: fixed -->
const email = ref("");
const password = ref("");
const rememberMe = ref(true);
+ const invalid = ref(false);
const { invoke } = useIpc();
try {
const res = await invoke('auth-session', payload);
setToken(res);
+ invalid.value = false;
router.push({ name: "home" });
} catch(e){
- console.log('Error loging in.')
+ invalid.value = true;
+ console.log('Error loging in.');
}
};
email,
password,
rememberMe,
- switchView
+ switchView,
+ invalid
};
},
});
flex-direction: column;
align-items: center;
justify-content: center;
- padding-bottom: 30px;
+ padding-bottom: 20px;
}
.inputBox {
cursor: pointer;
}
+.invalid {
+ margin-bottom: 30px;
+ font-family: "SF Compact Display";
+ font-weight: bold;
+ font-size: 14px;
+ color: #F53737;
+}
+
</style>