Fix vue appolo graphql middleware
This commit is contained in:
parent
3c1b0448a8
commit
649bc5624d
1
.gitignore
vendored
1
.gitignore
vendored
@ -16,6 +16,7 @@ erl_crash.dump
|
|||||||
/config/*.secret.exs
|
/config/*.secret.exs
|
||||||
|
|
||||||
.env.production
|
.env.production
|
||||||
|
.env
|
||||||
|
|
||||||
setup_db.psql
|
setup_db.psql
|
||||||
|
|
||||||
|
@ -110,8 +110,9 @@
|
|||||||
this.credentials.password = this.password;
|
this.credentials.password = this.password;
|
||||||
}
|
}
|
||||||
|
|
||||||
loginAction(e) {
|
loginAction(e: Event) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
this.$apollo.mutate({
|
this.$apollo.mutate({
|
||||||
mutation: LOGIN,
|
mutation: LOGIN,
|
||||||
variables: {
|
variables: {
|
||||||
@ -119,6 +120,7 @@
|
|||||||
password: this.credentials.password,
|
password: this.credentials.password,
|
||||||
},
|
},
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
|
console.log(result)
|
||||||
this.saveUserData(result.data);
|
this.saveUserData(result.data);
|
||||||
this.$router.push({ name: 'Home' });
|
this.$router.push({ name: 'Home' });
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
|
@ -42,7 +42,7 @@ const authMiddleware = new ApolloLink((operation, forward) => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (forward) forward(operation);
|
if (forward) return forward(operation);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user