Fixed an insidious memory leak in our app with AWS Amplify (Auth) and Next JS. The issue was with the `AuthClass` object being created on every call to render the page.
The solution I've implemented is to cache `withSSRContext` for up to an hour; it stops `AuthClass` from being created multiple times and only returning a cached copy of it for use the app.
The solution I've implemented is to cache `withSSRContext` for up to an hour; it stops `AuthClass` from being created multiple times and only returning a cached copy of it for use the app.