I am working on a react application using redux and React-Google-login to authenticate the user. I noticed that upon login, I am able to access the sign in tokens and other user information but when I refresh the page, all information about the user is lost and the app is brought back to its original state.
Please, how do I resolve this?
//login function
const login = (response) => {
console.log(response);
dispatch(setSignedIn(true));
dispatch(setUserData(response.profileObj));
}
<GoogleLogin
clientId='*******************'
render={(renderProps) => (
<button
onClick={renderProps.onClick}
disabled={renderProps.disabled}
className='login-button'
>
Login with Google
</button>
)}
onSuccess={login}
onFailure={login}
isSignedIn={true}
cookiePolicy={'single_host_origin'}
/>