Minor tweaks to login

This commit is contained in:
2023-11-16 22:11:48 -05:00
parent 214cfbd1be
commit b4687d6b79
3 changed files with 25 additions and 6 deletions

View File

@@ -32,7 +32,6 @@ defineEmits(['drawer-toggle']);
defineComponent({ defineComponent({
name: 'LeftDrawer', name: 'LeftDrawer',
}); });
console.log(links);
</script> </script>
<style lang="sass" scoped> <style lang="sass" scoped>

View File

@@ -1,7 +1,7 @@
<template> <template>
<q-page class="row justify-center"> <q-page class="row justify-center">
<q-img alt="OYS Logo" src="~assets/oysqn_logo.png" fit="scale-down" /> <q-img alt="OYS Logo" src="~assets/oysqn_logo.png" fit="scale-down" />
<q-list class="full-width"> <q-list class="full-width mobile-only">
<q-item v-for="link in links" :key="link.name"> <q-item v-for="link in links" :key="link.name">
<q-btn <q-btn
:icon="link.icon" :icon="link.icon"

View File

@@ -43,6 +43,22 @@
flat flat
></q-btn> --> ></q-btn> -->
</q-form> </q-form>
<q-dialog v-model="alert">
<q-card>
<q-card-section>
<div class="text-h6">Login Failed</div>
</q-card-section>
<q-card-section class="q-pt-none">
Login failed: {{ message }}
</q-card-section>
<q-card-actions align="right">
<q-btn flat label="OK" color="primary" v-close-popup />
</q-card-actions>
</q-card>
</q-dialog>
</q-card-section> </q-card-section>
</q-card> </q-card>
</q-page> </q-page>
@@ -81,6 +97,8 @@ const email = ref('');
const password = ref(''); const password = ref('');
const router = useRouter(); const router = useRouter();
const q = useQuasar(); const q = useQuasar();
const alert = ref(false);
const message = ref('');
function login(email: string, password: string) { function login(email: string, password: string) {
const notification = q.notify({ const notification = q.notify({
@@ -101,14 +119,16 @@ function login(email: string, password: string) {
spinner: false, spinner: false,
icon: 'check_circle', icon: 'check_circle',
}); });
router.push({ name: 'index' }); router.replace({ name: 'index' });
}) })
.catch((reason: Error) => { .catch(function (reason: Error) {
notification({ notification({
type: 'negative', type: 'negative',
message: 'Login failed. Error:' + reason.message, message: 'Login failed.',
timeout: 2000, timeout: 1,
}); });
message.value = reason.message;
alert.value = true;
}); });
} }
</script> </script>