aboutsummaryrefslogtreecommitdiff
path: root/front-end/src/views/Login/index.vue
diff options
context:
space:
mode:
authorLibravatar Vaughn Nugent <public@vaughnnugent.com>2024-01-31 14:31:45 -0500
committerLibravatar Vaughn Nugent <public@vaughnnugent.com>2024-01-31 14:31:45 -0500
commite4000144e6236f8afc3e2b7d6d11ff50248be1bd (patch)
tree77853294b3dcced363ea65791a3baeb3fbafb1eb /front-end/src/views/Login/index.vue
parent2889b3dd10de9a5df42f3f8ab2171b52893ac3f4 (diff)
parentf3661776f679a517f2b4fce0a8f583d1a2b0f854 (diff)
Merges pull request #1 cmnext-cli
Master changes to cli branch
Diffstat (limited to 'front-end/src/views/Login/index.vue')
-rw-r--r--front-end/src/views/Login/index.vue75
1 files changed, 36 insertions, 39 deletions
diff --git a/front-end/src/views/Login/index.vue b/front-end/src/views/Login/index.vue
index 6a55aeb..476ebf4 100644
--- a/front-end/src/views/Login/index.vue
+++ b/front-end/src/views/Login/index.vue
@@ -1,3 +1,38 @@
+<script setup lang="ts">
+import { computed } from 'vue'
+import { apiCall, useWait } from '@vnuge/vnlib.browser'
+import { isNil } from 'lodash-es'
+import { useStore } from '../../store'
+import { storeToRefs } from 'pinia'
+import UserPass from './components/UserPass.vue'
+import Social from './components/Social.vue'
+
+const store = useStore();
+const { loggedIn } = storeToRefs(store)
+const pkiEnabled = computed(() => !isNil(store.pki?.pkiAuth))
+
+store.setPageTitle('Login')
+
+const { waiting } = useWait()
+
+const submitLogout = async () => {
+ //Submit logout request
+ await apiCall(async ({ toaster }) => {
+ const { logout } = await store.socialOauth()
+ // Attempt to logout
+ await logout()
+ // Push a new toast message
+ toaster.general.success({
+ id: 'logout-success',
+ title: 'Success',
+ text: 'You have been logged out',
+ duration: 5000
+ })
+ })
+}
+
+</script>
+
<template>
<div id="login-template" class="app-component-entry">
<div class="login-container">
@@ -25,7 +60,7 @@
<Social />
<!-- pki button, forward to the pki route -->
- <div v-if="pkiEnabled" class="mt-3">
+ <div v-if="pkiEnabled" class="mt-4">
<router-link to="/login/pki">
<button type="submit" class="btn red social-button" :disabled="waiting">
<fa-icon :icon="['fa','certificate']" size="xl" />
@@ -39,44 +74,6 @@
</div>
</template>
-<script setup lang="ts">
-import { } from 'vue'
-import { apiCall, useWait } from '@vnuge/vnlib.browser'
-import { isNil } from 'lodash-es'
-import { useStore } from '../../store'
-import { storeToRefs } from 'pinia'
-import UserPass from './components/UserPass.vue'
-import Social from './components/Social.vue'
-
-//pki enabled flag from env
-const pkiEnabled = !isNil(import.meta.env.VITE_PKI_ENABLED);
-
-const store = useStore();
-const { loggedIn } = storeToRefs(store)
-
-store.setPageTitle('Login')
-
-const { waiting } = useWait()
-
-const submitLogout = async () => {
- //Submit logout request
- await apiCall(async ({ toaster }) => {
- // Attempt to logout
- const { logout } = await store.socialOauth()
- await logout()
-
- // Push a new toast message
- toaster.general.success({
- id: 'logout-success',
- title: 'Success',
- text: 'You have been logged out',
- duration: 5000
- })
- })
-}
-
-</script>
-
<style lang="scss">
#login-template {
.login-container{