From 59a1b083e02928593e3ab5a3f23d361c6303009b Mon Sep 17 00:00:00 2001 From: Jannik Schönartz Date: Mon, 4 Mar 2019 21:27:04 +0000 Subject: [server/setup] Move (initial) setup in it's own api file --- webapp/src/components/StartPageSetup.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'webapp') 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' }) -- cgit v1.2.3-55-g7522