summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorJannik Schönartz2019-03-04 22:27:04 +0100
committerJannik Schönartz2019-03-04 22:27:04 +0100
commit59a1b083e02928593e3ab5a3f23d361c6303009b (patch)
tree0beeeb4e73ef79252186c4098a604297c1b240ca /webapp
parenteslint fixes (diff)
downloadbas-59a1b083e02928593e3ab5a3f23d361c6303009b.tar.gz
bas-59a1b083e02928593e3ab5a3f23d361c6303009b.tar.xz
bas-59a1b083e02928593e3ab5a3f23d361c6303009b.zip
[server/setup] Move (initial) setup in it's own api file
Diffstat (limited to 'webapp')
-rw-r--r--webapp/src/components/StartPageSetup.vue11
1 files changed, 6 insertions, 5 deletions
diff --git a/webapp/src/components/StartPageSetup.vue b/webapp/src/components/StartPageSetup.vue
index 0d111bc..8b7e941 100644
--- a/webapp/src/components/StartPageSetup.vue
+++ b/webapp/src/components/StartPageSetup.vue
@@ -58,7 +58,7 @@ export default {
methods: {
setup () {
if (this.$refs.setupRoot.validate()) {
- this.$http.post('/api/authentication/setup', {
+ this.$http.post('/api/setup', {
username: this.user.username,
password: this.user.password,
name: this.user.name,
@@ -74,11 +74,12 @@ export default {
},
beforeRouteEnter (to, from, next) {
// If there are already users in the db, redirect to the login page.
- Vue.prototype.$http.get('/api/authentication/setup').then(result => {
- if (result.data.status !== 'SUCCESS') {
- next({ name: 'login' })
- } else {
+ Vue.prototype.$http.get('/api/setup/status').then(result => {
+ console.log(result.status === 200)
+ if (result.status === 200) {
next()
+ } else {
+ next({ name: 'login' })
}
}).catch(() => {
next({ name: 'login' })