From e3ce1c53226e2c7d2e8483fea3523b9c7ffaf703 Mon Sep 17 00:00:00 2001 From: Matteo Pagliazzi Date: Thu, 3 May 2018 18:06:01 +0200 Subject: [PATCH] possible fix for facebook auth bug --- website/client/components/auth/authForm.vue | 23 ++++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/website/client/components/auth/authForm.vue b/website/client/components/auth/authForm.vue index ced6e1e44f..c5b99ea86e 100644 --- a/website/client/components/auth/authForm.vue +++ b/website/client/components/auth/authForm.vue @@ -106,16 +106,23 @@ export default { }, methods: { async socialAuth (network) { - let auth = await hello(network).login({ - scope: 'email', - redirect_uri: '', // eslint-disable-line camelcase - }); + try { + let auth = await hello(network).login({ + scope: 'email', + redirect_uri: '', // eslint-disable-line camelcase + }); - await this.$store.dispatch('auth:socialAuth', { - auth, - }); + await this.$store.dispatch('auth:socialAuth', { + auth, + }); - await this.finishAuth(); + await this.finishAuth(); + } catch (err) { + console.error(err); // eslint-disable-line no-console + // logout the user + await hello(network).logout(); + this.socialAuth(network); // login again + } }, async register () { if (!this.email) {