From 71dadac7ce2594f1ad82d91c2581b75f9cba0610 Mon Sep 17 00:00:00 2001 From: sumedh Date: Thu, 8 Aug 2024 13:17:22 +0530 Subject: [PATCH] authentication done --- package-lock.json | 20 +++++++- package.json | 3 ++ src/layout/AppProfileMenu.vue | 18 +++++++ src/layout/AppTopbar.vue | 44 +++++++---------- src/main.js | 31 ++++++++++++ src/router/index.js | 56 ++++++++++++---------- src/views/pages/auth/Login.vue | 88 +++++++++++++++++++++------------- 7 files changed, 175 insertions(+), 85 deletions(-) create mode 100644 src/layout/AppProfileMenu.vue diff --git a/package-lock.json b/package-lock.json index f9b9fe1..cf81486 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "4.0.0", "dependencies": { "@primevue/themes": "^4.0.0", + "@websanova/vue-auth": "^4.2.1", "axios": "^1.7.2", "chart.js": "3.3.2", "moment": "^2.30.1", @@ -16,6 +17,7 @@ "primevue": "^4.0.0", "prismjs": "^1.29.0", "vue": "^3.4.34", + "vue-authenticate-2": "^2.2.0", "vue-router": "^4.4.0" }, "devDependencies": { @@ -924,7 +926,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -1123,6 +1124,11 @@ "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.34.tgz", "integrity": "sha512-x5LmiRLpRsd9KTjAB8MPKf0CDPMcuItjP0gbNqFCIgL1I8iYp4zglhj9w9FPCdIbHG2M91RVeIbArFfFTz9I3A==" }, + "node_modules/@websanova/vue-auth": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@websanova/vue-auth/-/vue-auth-4.2.1.tgz", + "integrity": "sha512-gc4WL3WzJMkj3wZmrBAP7U7WBAcVY0/a/YhCzMVR/iA1u/8QJlugq/320CRRbZ0Acz+qbGPhdm07IRE3U053yg==" + }, "node_modules/acorn": { "version": "8.12.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", @@ -3783,6 +3789,18 @@ } } }, + "node_modules/vue-authenticate-2": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/vue-authenticate-2/-/vue-authenticate-2-2.2.0.tgz", + "integrity": "sha512-4jk9Wv/bV6Bfk6LWQp5WESCe6hxkBrCQThFYqkg9F70q6auEDcdwzo2cVYWPFTwQE5UFX8C9MJUC2Wx6OYwdhw==", + "optionalDependencies": { + "@rollup/rollup-linux-x64-gnu": "^4.9.5" + }, + "peerDependencies": { + "axios": "^1.6.7", + "vue": "^3.4.21" + } + }, "node_modules/vue-eslint-parser": { "version": "9.4.3", "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-9.4.3.tgz", diff --git a/package.json b/package.json index db99a80..1f38e8b 100644 --- a/package.json +++ b/package.json @@ -9,12 +9,15 @@ }, "dependencies": { "@primevue/themes": "^4.0.0", + "@websanova/vue-auth": "^4.2.1", "axios": "^1.7.2", "chart.js": "3.3.2", "moment": "^2.30.1", "primeicons": "^6.0.1", "primevue": "^4.0.0", "vue": "^3.4.34", + "prismjs": "^1.29.0", + "vue-authenticate-2": "^2.2.0", "vue-router": "^4.4.0" }, "devDependencies": { diff --git a/src/layout/AppProfileMenu.vue b/src/layout/AppProfileMenu.vue new file mode 100644 index 0000000..4890963 --- /dev/null +++ b/src/layout/AppProfileMenu.vue @@ -0,0 +1,18 @@ + + + \ No newline at end of file diff --git a/src/layout/AppTopbar.vue b/src/layout/AppTopbar.vue index e52fb88..c87dce4 100644 --- a/src/layout/AppTopbar.vue +++ b/src/layout/AppTopbar.vue @@ -3,6 +3,9 @@ import { useLayout } from '@/layout/composables/layout'; import AppConfigurator from './AppConfigurator.vue'; const { onMenuToggle, toggleDarkMode, isDarkTheme } = useLayout(); +import { useAuth } from '@websanova/vue-auth/src/v3.js'; +import AppProfileMenu from './AppProfileMenu.vue'; +const auth = useAuth();