diff --git a/src/components/EditProfile.vue b/src/components/EditProfile.vue index aef56dfc497e03af73a5c481c8bea27371f60839..c98dcbc9a97897e345aa788e0e4339aa010e09ea 100644 --- a/src/components/EditProfile.vue +++ b/src/components/EditProfile.vue @@ -78,7 +78,8 @@ export default { const id = this.profile.id; const numOfProfiles = API.getProfiles().length - if(numOfProfiles===1 && this.updatedProfile.upRestricted===true){ + console.log("antall profiler: " + numOfProfiles) //todo + if(numOfProfiles===1 && this.updatedProfile.upRestricted==true){ alert("Du må ha minst en standardprofil per konto. (ingen endringer er gjort)") } else { diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue index b9818287498d55d49d7edff45d776343e08745d4..f220c31abc889372b7e12cf367708e40469ad19f 100644 --- a/src/components/Navbar.vue +++ b/src/components/Navbar.vue @@ -1,6 +1,6 @@ <template> <div> - <nav> + <nav v-if="isLoggedIn"> <ul :aria-label = "'Navigation links'"> <li> <RouterLink :to="'/'" :aria-label="'link to home page'"> @@ -36,6 +36,7 @@ <script> import { Icon } from '@iconify/vue'; import Logo from "@/components/Logo.vue"; +import {useAuthStore} from "@/stores/authStore"; export default { name: "Navbar", @@ -49,7 +50,10 @@ export default { }, logoSize() { return '52px'; - } + }, + isLoggedIn(){ + return useAuthStore().isLoggedIn; + } } } </script> diff --git a/src/views/LoginView.vue b/src/views/LoginView.vue index fe18b47e8ece9dd949df35e5b0517c8c9c22c3a5..77618971030bf7cf0ff025bf08d5e7e49e20fcef 100644 --- a/src/views/LoginView.vue +++ b/src/views/LoginView.vue @@ -1,6 +1,7 @@ <script> import { API } from '@/util/API.js'; import router from '@/router/index.js'; + import {useAuthStore} from "@/stores/authStore"; export default { data() { @@ -11,6 +12,9 @@ errormsg: "", } }, + created(){ + useAuthStore().logout(); + }, methods: { login() { //todo: implement when API is up