mirror of
https://github.com/kaythomas0/noisedash.git
synced 2025-11-16 13:08:04 +00:00
Add logout and nav drawyer
This commit is contained in:
@@ -16,6 +16,7 @@ router.get('/auth', function (req, res) {
|
|||||||
|
|
||||||
router.get('/logout', function (req, res, next) {
|
router.get('/logout', function (req, res, next) {
|
||||||
req.logout()
|
req.logout()
|
||||||
|
res.sendStatus(200)
|
||||||
})
|
})
|
||||||
|
|
||||||
module.exports = router
|
module.exports = router
|
||||||
|
|||||||
@@ -1,16 +1,77 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-app-bar
|
<v-container>
|
||||||
app
|
<v-app-bar
|
||||||
color="secondary"
|
app
|
||||||
dark
|
color="secondary"
|
||||||
dense
|
dark
|
||||||
>
|
dense
|
||||||
<v-container fill-height>
|
>
|
||||||
<v-switch
|
<v-app-bar-nav-icon
|
||||||
v-model="$vuetify.theme.dark"
|
@click="drawyer = true"
|
||||||
inset
|
|
||||||
label="Dark Mode"
|
|
||||||
/>
|
/>
|
||||||
</v-container>
|
</v-app-bar>
|
||||||
</v-app-bar>
|
<v-navigation-drawer
|
||||||
|
v-model="drawyer"
|
||||||
|
absolute
|
||||||
|
temporary
|
||||||
|
>
|
||||||
|
<v-list
|
||||||
|
nav
|
||||||
|
>
|
||||||
|
<v-list-item-group
|
||||||
|
v-model="group"
|
||||||
|
>
|
||||||
|
<v-list-item>
|
||||||
|
<v-list-item-icon>
|
||||||
|
<v-icon>mdi-home</v-icon>
|
||||||
|
</v-list-item-icon>
|
||||||
|
<v-list-item-title>
|
||||||
|
Home
|
||||||
|
</v-list-item-title>
|
||||||
|
</v-list-item>
|
||||||
|
<v-list-item
|
||||||
|
@click="logout"
|
||||||
|
>
|
||||||
|
<v-list-item-icon>
|
||||||
|
<v-icon>mdi-logout</v-icon>
|
||||||
|
</v-list-item-icon>
|
||||||
|
<v-list-item-title>
|
||||||
|
Logout
|
||||||
|
</v-list-item-title>
|
||||||
|
</v-list-item>
|
||||||
|
<v-list-item>
|
||||||
|
<v-switch
|
||||||
|
v-model="$vuetify.theme.dark"
|
||||||
|
inset
|
||||||
|
label="Dark Mode"
|
||||||
|
/>
|
||||||
|
</v-list-item>
|
||||||
|
</v-list-item-group>
|
||||||
|
</v-list>
|
||||||
|
</v-navigation-drawer>
|
||||||
|
</v-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'AppBar',
|
||||||
|
|
||||||
|
data: () => ({
|
||||||
|
drawyer: false,
|
||||||
|
group: null
|
||||||
|
}),
|
||||||
|
methods: {
|
||||||
|
logout () {
|
||||||
|
this.$http.get('https://localhost:3000/logout')
|
||||||
|
.then(response => {
|
||||||
|
if (response.status === 200) {
|
||||||
|
this.$router.push('/login')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(function (error) {
|
||||||
|
console.error(error.response)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user