# Next.js Authentication Tutorial: Testing

**URL:** <https://community.auth0.com/t/next-js-authentication-tutorial-testing/28647>\
**Category:** Get Help\
**Tags:** testing, nextjs, auth0\
**Created:** [July 27, 2019, 4:33pm UTC](https://community.auth0.com/t/next-js-authentication-tutorial-testing/28647 "2019-07-27T16:33:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dazsnow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dazsnow/32/15063_2.png) [@dazsnow](https://community.auth0.com/u/dazsnow)\
**Post date:** [July 27, 2019, 4:33pm UTC](https://community.auth0.com/t/next-js-authentication-tutorial-testing/28647/1 "2019-07-27T16:33:05Z")

</div>

> **[How to Authenticate with Next.js and Auth0: A Guide for Every Deployment Model](https://auth0.com/blog/ultimate-guide-nextjs-authentication-auth0/)**
>
> Learn how and where to authenticate your user in the different deployment models that exist for Next.js. This guide explores the Custom S...

Would be great to see an example that includes tests.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [July 29, 2019, 7:07am UTC](https://community.auth0.com/t/next-js-authentication-tutorial-testing/28647/2 "2019-07-29T07:07:29Z")

</div>

Thanks a lot for the feedback! Let me relay that to the person responsible for that article!

---

<div class="post-metadata">

**Author:** ![kkomaz](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kkomaz/32/19884_2.png) [@kkomaz](https://community.auth0.com/u/kkomaz)\
**Post date:** [March 17, 2020, 8:36pm UTC](https://community.auth0.com/t/next-js-authentication-tutorial-testing/28647/4 "2020-03-17T20:36:15Z")

</div>

I had a question about this tutorial. I noticed every time i shut down the server i have to log back in again.

Is there a way to persist the session and how I would go about doing this properly? From my research, I ned to modify `sessionConfig` to include a store key. I saw examples saving it mongo but is that ideal? Ideally I want to persist it in the scope of auth0 but I cant seem to figure it out…

```auto
    store: new MongoStore(
    {mongooseConnection:mongoose.connection}
    )     

```

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 18, 2020, 11:20am UTC](https://community.auth0.com/t/next-js-authentication-tutorial-testing/28647/5 "2020-03-18T11:20:41Z")

</div>

Hey there! Let me connect you with article author @bruno.krebs to assist you in your struggle!
