Replies: 1 comment 1 reply
-
So first, you probably don't want to block the rendering of pages for every route while waiting for the You can have a look at my approach here: #1210 (comment) That would probably make pages "faster" in a sense that non-authenticated pages would render immediatelly, rather than having to wait for auth state to change. As for pages needing auth. The session lookup is as fast as your network config, and if you don't use a database, looking up user data should be relatively fast already, as it only parses a cookie on the backend and sets the content back. If you use a database, please check if not the database calls are the bottleneck. I can also see you are using On a last comment, |
Beta Was this translation helpful? Give feedback.
-
Hey,
I am new to next-auth, and I am setting this up on a project, and I have realized that the app is stuck on the

loading
state for some time. It seems like the session looks up isn't that fast, at least on my app/setup. I have attached a screenshot of a lighthouse audit; the app stays in the loading state for a few seconds, making my score go down.Below is my setup;
Also, is there a convention for passing the
accessToken
in any API calls header in a performant way without callinggetSession
for each request?Beta Was this translation helpful? Give feedback.
All reactions