Minor tweaks to login
This commit is contained in:
@@ -32,7 +32,6 @@ defineEmits(['drawer-toggle']);
|
||||
defineComponent({
|
||||
name: 'LeftDrawer',
|
||||
});
|
||||
console.log(links);
|
||||
</script>
|
||||
|
||||
<style lang="sass" scoped>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<q-page class="row justify-center">
|
||||
<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-btn
|
||||
:icon="link.icon"
|
||||
|
||||
@@ -43,6 +43,22 @@
|
||||
flat
|
||||
></q-btn> -->
|
||||
</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>
|
||||
</q-page>
|
||||
@@ -81,6 +97,8 @@ const email = ref('');
|
||||
const password = ref('');
|
||||
const router = useRouter();
|
||||
const q = useQuasar();
|
||||
const alert = ref(false);
|
||||
const message = ref('');
|
||||
|
||||
function login(email: string, password: string) {
|
||||
const notification = q.notify({
|
||||
@@ -101,14 +119,16 @@ function login(email: string, password: string) {
|
||||
spinner: false,
|
||||
icon: 'check_circle',
|
||||
});
|
||||
router.push({ name: 'index' });
|
||||
router.replace({ name: 'index' });
|
||||
})
|
||||
.catch((reason: Error) => {
|
||||
.catch(function (reason: Error) {
|
||||
notification({
|
||||
type: 'negative',
|
||||
message: 'Login failed. Error:' + reason.message,
|
||||
timeout: 2000,
|
||||
message: 'Login failed.',
|
||||
timeout: 1,
|
||||
});
|
||||
message.value = reason.message;
|
||||
alert.value = true;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user