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
diff --git a/src/components/AppHeader/AppHeader.vue b/src/components/AppHeader/AppHeader.vue
index 9177403..8dacd03 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 @@
methods: {
getHostInfo() {
this.$store.dispatch("global/getHostName");
+ },
+ logout() {
+ this.$store.dispatch("authentication/logout").then(() => {
+ this.$router.push("/login");
+ });
}
}
};