From 39ea574258ca44921baa84fec23ef74c1c95bc09 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 19 Jul 2022 20:19:24 +0000 Subject: [PATCH] --- ayanova/src/App.vue | 7 ++++++- ayanova/src/views/login.vue | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ayanova/src/App.vue b/ayanova/src/App.vue index 811f9ea4..6f734228 100644 --- a/ayanova/src/App.vue +++ b/ayanova/src/App.vue @@ -315,6 +315,7 @@ export default { }, mounted() { const vm = this; + vm.$vuetify.theme.dark = vm.$store.state.darkMode; vm.$root.$gzconfirm = vm.$refs.gzconfirm.open; vm.$root.$gznotify = vm.$refs.gznotify.addNotification; @@ -342,6 +343,7 @@ export default { if (!vm.$store.state.authenticated && !isReset) { //If a direct open path was being used but user is not logged in this will catch it //otherwise they will just go on to that path directly + // eslint-disable-next-line no-debugger if (toPath != undefined) { vm.$router.push({ @@ -353,7 +355,10 @@ export default { }); } else { vm.$router.push({ - name: "login" + name: "login", + params: { + search: window.location.search + } }); } } diff --git a/ayanova/src/views/login.vue b/ayanova/src/views/login.vue index a2fd0e24..937cfca0 100644 --- a/ayanova/src/views/login.vue +++ b/ayanova/src/views/login.vue @@ -366,6 +366,7 @@ export default { vm.input.username = vm.$route.params.presetLogin; vm.input.password = vm.$route.params.presetPassword; } + vm.smallLogoUrl = window.$gz.api.logoUrl("small"); vm.mediumLogoUrl = window.$gz.api.logoUrl("medium"); vm.largeLogoUrl = window.$gz.api.logoUrl("large"); @@ -384,6 +385,19 @@ export default { vm.hasLargeLogo = res.data.ll; vm.lcr = res.data.lcr; //license consent required flag } + + //Live eval from website redirects here with generated creds set + // ...login?usr={username}&pw={pw} + //anything in window.location.search is placed in the 'search' route parameter by app.vue for parsing here because they are lost when the redirect happens to the login form as it's actually app.vue that gets hit first not login + //Note that the $route.query system does not work no matter what I tried and seems to be broken in vue router so have to do it ourselves from the + //Handle search query params + if (vm.$route.params.search != undefined) { + let params = new URLSearchParams(vm.$route.params.search); + if (params.has("usr")) { + vm.input.username = params.get("usr"); + vm.input.password = params.get("pw"); + } + } } catch (error) { //squash it, this isn't critical }