Skip to content
Snippets Groups Projects
Commit 18fcb49b authored by Titus Netland's avatar Titus Netland
Browse files

Merge branch 'logout_in_profile' into 'main'

Added logout functionality

See merge request !38
parents 12c148de 9ab7f520
No related branches found
No related tags found
1 merge request!38Added logout functionality
Pipeline #176920 passed
......@@ -49,6 +49,13 @@
>Leiehistorikk</router-link
>
</li>
<li>
<div
@click="logout"
class="cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white"
>Logg ut
</div>
</li>
<li>
<router-link
to="/newPassword"
......@@ -118,7 +125,7 @@ export default {
this.currentUser = await parseCurrentUser();
this.id = await this.$router.currentRoute.value.params.id;
if (this.id == this.currentUser.accountId) {
if (this.id === this.currentUser.accountId) {
this.isCurrentUser = true;
this.user = this.currentUser;
return;
......@@ -131,11 +138,15 @@ export default {
}
},
getProfilePicture() {
if (this.user.picture != "") {
if (this.user.picture !== "") {
return this.user.picture;
}
return "../assets/defaultUserProfileImage.jpg";
},
logout(){
this.$store.commit('logout');
this.$router.push('/')
}
},
beforeMount() {
this.getUser();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment