# Auth0 React SDK "Login with Google" doesn't persist session between routes

**URL:** <https://community.auth0.com/t/auth0-react-sdk-login-with-google-doesnt-persist-session-between-routes/60543>\
**Category:** Get Help\
**Tags:** react-sdk, react, google-authenticator\
**Created:** [April 5, 2021, 2:35am UTC](https://community.auth0.com/t/auth0-react-sdk-login-with-google-doesnt-persist-session-between-routes/60543 "2021-04-05T02:35:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lp22](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lp22/32/18355_2.png) [@lp22](https://community.auth0.com/u/lp22)\
**Post date:** [April 5, 2021, 2:35am UTC](https://community.auth0.com/t/auth0-react-sdk-login-with-google-doesnt-persist-session-between-routes/60543/1 "2021-04-05T02:35:28Z")

</div>

Hello,  
I am using auth0 SDK with a React App: “@auth0/auth0-react”: “^1.3.0”  
My app is based on React [sample app](https://github.com/auth0-samples/auth0-react-samples/tree/master/Sample-01)  
Everything works fine, except when users "Login with Google ", it doesn’t seem to persist session token when users navigate to a different route. When a new route is clicked it redirects to the auth0 login page.  
As mentioned above this app is based on auth0-react-samples project, my routes layout looks like this:

```
<Router>      
        <Auth0ProviderWithHistory>            
            <NavBar></NavBar>
                <div className="app-content">
                    <Switch>
                        
                        <ProtectedRoute path="/home" component={Home}></ProtectedRoute>
                        <ProtectedRoute path="/notes" component={NotesView}></ProtectedRoute>
                        <ProtectedRoute path="/todos" component={ToDosView}></ProtectedRoute>
                        <Route path="/">
                            <Home />
                        </Route>
                    </Switch>                        
                </div>  
                </Auth0ProviderWithHistory>         
          </Router> 

```

I should also mention that I am using TypeScript where the sample app is Js, that’s the only major difference.

So how come “Login with Google” doesn’t seem to work between routes? Did anyone else experience this issue?

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [April 7, 2021, 12:28pm UTC](https://community.auth0.com/t/auth0-react-sdk-login-with-google-doesnt-persist-session-between-routes/60543/3 "2021-04-07T12:28:47Z")

</div>

Hi @lp22,

Welcome to the Community!

Have you set up your own credentials with Google? If you happen to be using the default settings with the Auth0 developer keys, authentication will not persist (the developer keys are for temporary testing purposes only).

[https://auth0.com/docs/connections/social/google](https://auth0.com/docs/connections/social/google)

Related FAQ: [Why is authentication lost after refreshing my single page application? - #2](https://community.auth0.com/t/why-is-authentication-lost-after-refreshing-my-single-page-application/56276/2)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [April 22, 2021, 12:29pm UTC](https://community.auth0.com/t/auth0-react-sdk-login-with-google-doesnt-persist-session-between-routes/60543/4 "2021-04-22T12:29:23Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
