From 4868662e9a44c61d68ffad1f19d9923baf29bf5b Mon Sep 17 00:00:00 2001 From: Eric Leung Date: Sun, 26 Apr 2020 14:35:32 +1200 Subject: [PATCH] Used firebase localstorage to get user account info (#207) * Used firebase localstorage to get user account info * Removed comment lines --- frontend/src/common/Header/Login.jsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/common/Header/Login.jsx b/frontend/src/common/Header/Login.jsx index 5af7a49..6764816 100644 --- a/frontend/src/common/Header/Login.jsx +++ b/frontend/src/common/Header/Login.jsx @@ -38,6 +38,10 @@ const Login = ({ handleLogin, displayProfile }) => { const handleButtonShow = () => { if (document.cookie) { + const storedPostTypes = JSON.parse(localStorage.getItem('firebaseui::rememberedAccounts')); + if (storedPostTypes) { + handleLogin(true, storedPostTypes[0].displayName, storedPostTypes[0].photoUrl); + } return null; }