From 12cf3d7264d3750448ed1e0fa2ea868269879047 Mon Sep 17 00:00:00 2001 From: igoradamenko Date: Wed, 14 Feb 2018 01:29:52 +0200 Subject: [PATCH] fix saving data of current user after logging in --- web/app/components/root/root.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/app/components/root/root.jsx b/web/app/components/root/root.jsx index bc0e8d35..765d1576 100644 --- a/web/app/components/root/root.jsx +++ b/web/app/components/root/root.jsx @@ -54,7 +54,7 @@ export default class Root extends Component { } onSignIn(provider) { - const newWindow = window.open(`${baseUrl}/auth/${provider}/login?from=${location.href}`); + const newWindow = window.open(`${baseUrl}/auth/${provider}/login?from=${encodeURIComponent(location.href)}`); let secondsPass = 0; const checkMsDelay = 200; @@ -65,8 +65,8 @@ export default class Root extends Component { clearInterval(checkInterval); newWindow.close(); api.getUser() - .then(data => { - store.set('user', data); + .then(user => { + store.set('user', user); this.setState({ user }); }) .catch(() => {}) // TODO: we need to handle it and write error to user