Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

80
Views
React-Google signing keep logging out upon refresh/reload

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'}
                    />

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!