From e080a1a7593e83a49d623ffdd452fd0e1c617889 Mon Sep 17 00:00:00 2001
From: Derick Montague <derick.montague@ibm.com>
Date: Wed, 4 Dec 2019 16:30:08 -0600
Subject: Add login and logout functionality

- Add AuthenticationStore
- Add ability to login and logout
- Add route navigation guard
- Add login styles
- Add temporary authentication for api call
- Add Login directory
- Add index.js

In order to login a .env.development.local file that contains
BASE_URL="https://<ip address> or <FQDN>"

Signed-off-by: Derick Montague <derick.montague@ibm.com>
Change-Id: I88b93e287e66f4bae82a1ec2934cdef12d78264e
---
 src/components/AppHeader/AppHeader.vue | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

(limited to 'src/components/AppHeader/AppHeader.vue')

diff --git a/src/components/AppHeader/AppHeader.vue b/src/components/AppHeader/AppHeader.vue
index 9177403c..8dacd03d 100644
--- a/src/components/AppHeader/AppHeader.vue
+++ b/src/components/AppHeader/AppHeader.vue
@@ -7,9 +7,9 @@
           <b-nav-text>BMC System Management</b-nav-text>
         </b-navbar-nav>
         <b-navbar-nav small class="ml-auto">
-          <b-nav-item>
+          <b-nav-item @click="logout">
             <user-avatar-20 />
-            User Avatar
+            Logout
           </b-nav-item>
         </b-navbar-nav>
       </b-navbar>
@@ -77,6 +77,11 @@ export default {
   methods: {
     getHostInfo() {
       this.$store.dispatch("global/getHostName");
+    },
+    logout() {
+      this.$store.dispatch("authentication/logout").then(() => {
+        this.$router.push("/login");
+      });
     }
   }
 };
-- 
cgit v1.2.3

