Add profile deletion, hide admin page to non-admins

This commit is contained in:
Kevin Thomas
2021-08-07 23:46:20 -07:00
parent cb1904ec2f
commit cd6af207be
7 changed files with 137 additions and 21 deletions

View File

@@ -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()
}