Register users from admin page

This commit is contained in:
Kevin Thomas
2021-11-05 23:04:34 -07:00
parent f2d1b80673
commit 69a467b13b
11 changed files with 245 additions and 69 deletions

View File

@@ -67,6 +67,19 @@ router.beforeEach((to, from, next) => {
console.error(error.response)
next('/')
})
} else if (to.name === 'Register') {
instance.get('/users')
.then(response => {
if (response.data.users.length !== 0) {
next('/')
} else {
next()
}
})
.catch((error) => {
console.error(error.response)
next('/')
})
} else {
next()
}