mirror of
https://github.com/kaythomas0/noisedash.git
synced 2025-11-16 04:58:02 +00:00
Add profile deletion, hide admin page to non-admins
This commit is contained in:
@@ -59,6 +59,19 @@ router.beforeEach((to, from, next) => {
|
||||
console.error(error.response)
|
||||
next('/login')
|
||||
})
|
||||
} else if (to.name === 'Admin') {
|
||||
instance.get('/admin')
|
||||
.then(response => {
|
||||
if (response.status === 200) {
|
||||
next()
|
||||
} else {
|
||||
next('/')
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.error(error.response)
|
||||
next('/')
|
||||
})
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user