Skip to content

Commit f35aa88

Browse files
committed
fixed google signin integration
when i adjusted the signin code to not use internal properties previously, i missed one in the GoogleButton itself. that has been remedied
1 parent 86d4684 commit f35aa88

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

frontend/src/components/GoogleButton.vue

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import auth2 from "../auth2";
1818
export default {
1919
name: "GoogleButton",
2020
props: {
21-
noListen: Boolean
21+
noListen: Boolean,
2222
},
2323
async mounted() {
2424
this.auth2 = await auth2();
@@ -35,21 +35,21 @@ export default {
3535
},
3636
data: () => {
3737
return {
38-
auth2: null
38+
auth2: null,
3939
};
4040
},
4141
computed: {
4242
...mapGetters({
43-
loggedIn: "user/signedIn"
44-
})
43+
loggedIn: "user/signedIn",
44+
}),
4545
},
4646
methods: {
4747
...mapActions({
4848
login: "user/login",
4949
logout: "user/logout",
5050
updateFlags: "leads/updateAllFlags",
5151
clearFlags: "leads/clearAllFlags",
52-
clearAlerts: "alerts/clear"
52+
clearAlerts: "alerts/clear",
5353
}),
5454
async signout() {
5555
try {
@@ -59,7 +59,7 @@ export default {
5959
this.clearFlags();
6060
this.clearAlerts();
6161
this.$bvToast.toast("You have been logged out.", {
62-
title: "Logout successful."
62+
title: "Logout successful.",
6363
});
6464
} catch (err) {
6565
this.loginError(err, false);
@@ -71,19 +71,19 @@ export default {
7171
this.$bvToast.toast(`Unable to ${type}: ${err.message}.`, {
7272
title: `${type} failed.`,
7373
autoHideDelay: 10000,
74-
variant: "danger"
74+
variant: "danger",
7575
});
7676
},
7777
async signin(user) {
78-
if (!user.wc) {
79-
// logout --- but this is called by gapi so w/e
78+
if (!user.getAuthResponse().id_token) {
79+
// no token present---this is a logout call triggered by the currentUser listener
8080
return;
8181
}
8282
try {
8383
await this.login(user);
8484
8585
this.$bvToast.toast("You have been logged in.", {
86-
title: "Login successful."
86+
title: "Login successful.",
8787
});
8888
} catch (err) {
8989
this.loginError(err);
@@ -96,10 +96,10 @@ export default {
9696
9797
this.$bvToast.toast("Unable to update flags.", {
9898
title: "Error",
99-
variant: "danger"
99+
variant: "danger",
100100
});
101101
}
102-
}
103-
}
102+
},
103+
},
104104
};
105105
</script>

0 commit comments

Comments
 (0)