From d42769ca45581db8850f5df90b611a8cca140bc6 Mon Sep 17 00:00:00 2001 From: Douglas Barone Date: Wed, 28 Jun 2023 09:37:13 -0400 Subject: [PATCH] Login ok --- web/src/layouts/default/View.vue | 44 ++++++++++++++++++++++++++++---- web/src/layouts/simple/View.vue | 6 +---- web/src/plugins/vuetify.ts | 28 ++++++++++---------- web/src/views/Login.vue | 5 ++++ 4 files changed, 59 insertions(+), 24 deletions(-) diff --git a/web/src/layouts/default/View.vue b/web/src/layouts/default/View.vue index 817efae..9b727cf 100644 --- a/web/src/layouts/default/View.vue +++ b/web/src/layouts/default/View.vue @@ -1,13 +1,36 @@ - + diff --git a/web/src/plugins/vuetify.ts b/web/src/plugins/vuetify.ts index c276519..5bdf82f 100644 --- a/web/src/plugins/vuetify.ts +++ b/web/src/plugins/vuetify.ts @@ -5,22 +5,22 @@ */ // Styles -import '@mdi/font/css/materialdesignicons.css' -import 'vuetify/styles' +import "@mdi/font/css/materialdesignicons.css"; +import "vuetify/styles"; // Composables -import { createVuetify } from 'vuetify' +import { createVuetify } from "vuetify"; // https://vuetifyjs.com/en/introduction/why-vuetify/#feature-guides export default createVuetify({ - theme: { - themes: { - light: { - colors: { - primary: '#1867C0', - secondary: '#5CBBF6', - }, - }, - }, - }, -}) + // theme: { + // themes: { + // light: { + // colors: { + // primary: '#1867C0', + // secondary: '#5CBBF6', + // }, + // }, + // }, + // }, +}); diff --git a/web/src/views/Login.vue b/web/src/views/Login.vue index 04bb08d..d37a983 100644 --- a/web/src/views/Login.vue +++ b/web/src/views/Login.vue @@ -64,6 +64,7 @@ import { ref, reactive } from "vue"; import { api } from "@/api"; import { saveJwtToken } from "@/auth"; import { useRouter } from "vue-router"; +import { useAppStore } from "@/store/app"; const username = ref(""); const password = ref(""); @@ -75,6 +76,8 @@ const loading = ref(false); const router = useRouter(); +const { fetchMe } = useAppStore(); + async function login() { errors.splice(0, errors.length); @@ -92,6 +95,8 @@ async function login() { saveJwtToken(token); + await fetchMe(); + router.push({ name: "Home" }); } catch (error: any) { errors.push(error.message);