You've already forked AstralRinth
forked from didirus/AstralRinth
@@ -88,7 +88,7 @@
|
|||||||
<span class="title">Moderation</span>
|
<span class="title">Moderation</span>
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
<hr class="divider" />
|
<hr class="divider" />
|
||||||
<button class="item button-transparent" @click="logout">
|
<button class="item button-transparent" @click="logout()">
|
||||||
<LogOutIcon class="icon" />
|
<LogOutIcon class="icon" />
|
||||||
<span class="dropdown-item__text">Log out</span>
|
<span class="dropdown-item__text">Log out</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -162,7 +162,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="links">
|
<div class="links">
|
||||||
<template v-if="auth.user">
|
<template v-if="auth.user">
|
||||||
<button class="iconified-button danger-button" @click="logout">
|
<button class="iconified-button danger-button" @click="logout()">
|
||||||
<LogOutIcon aria-hidden="true" />
|
<LogOutIcon aria-hidden="true" />
|
||||||
Log out
|
Log out
|
||||||
</button>
|
</button>
|
||||||
@@ -471,27 +471,21 @@ export default defineNuxtComponent({
|
|||||||
this.isMobileMenuOpen = false
|
this.isMobileMenuOpen = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async logout() {
|
logout() {
|
||||||
useCookie('auth-token').value = null
|
useCookie('auth-token').value = null
|
||||||
|
|
||||||
// If users logs out on dashboard, force redirect on the home page to clear cookies
|
this.$notify({
|
||||||
if (
|
group: 'main',
|
||||||
this.$route.path.startsWith('/settings/') ||
|
title: 'Logged Out',
|
||||||
this.$route.path.startsWith('/dashboard/') ||
|
text: 'You have logged out successfully!',
|
||||||
this.$route.path.startsWith('/moderation') ||
|
type: 'success',
|
||||||
this.$route.path.startsWith('/notifications')
|
})
|
||||||
) {
|
|
||||||
window.location.href = '/'
|
|
||||||
} else {
|
|
||||||
await this.$router.go(null)
|
|
||||||
|
|
||||||
this.$notify({
|
useRouter()
|
||||||
group: 'main',
|
.push('/')
|
||||||
title: 'Logged Out',
|
.then(() => {
|
||||||
text: 'You have logged out successfully!',
|
useRouter().go()
|
||||||
type: 'success',
|
|
||||||
})
|
})
|
||||||
}
|
|
||||||
},
|
},
|
||||||
changeTheme() {
|
changeTheme() {
|
||||||
this.isThemeSwitchOnHold = true
|
this.isThemeSwitchOnHold = true
|
||||||
|
|||||||
Reference in New Issue
Block a user