mirror of
https://github.com/kaythomas0/noisedash.git
synced 2025-11-15 20:48:03 +00:00
Register users from admin page
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user