From 649bc5624d49e234fa0299b060ccc6fd04494718 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 28 Dec 2018 15:41:32 +0100 Subject: [PATCH] Fix vue appolo graphql middleware --- .gitignore | 1 + js/src/components/Account/Login.vue | 4 +++- js/src/vue-apollo.ts | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 6f8b86103..9ac504227 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ erl_crash.dump /config/*.secret.exs .env.production +.env setup_db.psql diff --git a/js/src/components/Account/Login.vue b/js/src/components/Account/Login.vue index dcc74a40d..35897bc41 100644 --- a/js/src/components/Account/Login.vue +++ b/js/src/components/Account/Login.vue @@ -110,8 +110,9 @@ this.credentials.password = this.password; } - loginAction(e) { + loginAction(e: Event) { e.preventDefault(); + this.$apollo.mutate({ mutation: LOGIN, variables: { @@ -119,6 +120,7 @@ password: this.credentials.password, }, }).then((result) => { + console.log(result) this.saveUserData(result.data); this.$router.push({ name: 'Home' }); }).catch((e) => { diff --git a/js/src/vue-apollo.ts b/js/src/vue-apollo.ts index 0a613e000..beb57297a 100644 --- a/js/src/vue-apollo.ts +++ b/js/src/vue-apollo.ts @@ -42,7 +42,7 @@ const authMiddleware = new ApolloLink((operation, forward) => { }, }); - if (forward) forward(operation); + if (forward) return forward(operation); return null; });