From f80cd2d543a21211650e1d17e737d04c42b9a151 Mon Sep 17 00:00:00 2001 From: "mati108@gmail.com" <34651529+matbenitez@users.noreply.github.com> Date: Mon, 15 Oct 2018 10:09:10 -0300 Subject: [PATCH] Fixing authentication workflow --- client/src/auth/index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/client/src/auth/index.js b/client/src/auth/index.js index 61b90eb6e..47daf01db 100644 --- a/client/src/auth/index.js +++ b/client/src/auth/index.js @@ -182,21 +182,21 @@ class Auth { async signinOrCreateAccount ({ accessToken, idToken, expiresAt }) { try { - const data = await client.mutate({ + const response = await client.mutate({ mutation: AUTHENTICATE, variables: { idToken } }) Log.info('auth.signinOrCreateAccount data:') - Log.info(await data) + Log.info(response) const user = { - authId: await data.teams_Authenticate.authId, - alias: await data.teams_Authenticate.alias + authId: response.data.teams_Authenticate.authId, + alias: response.data.teams_Authenticate.alias } setItem('user', JSON.stringify(user)) if (window.location.href.includes(`callback`)) { - window.location.href = '/dashboard' + window.location.href = '/' } - return data + return response.data } catch (err) { return console.log('Sign in or create account error: ', err) }