-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation Gap for auth()
Method in Next-Auth
#10562
Comments
Hey thanks for pointing this out! We've added some copy regarding client components, but nothing specifically regarding |
Thank you for your quick response and for considering the addition to the documentation! To clarify, my primary concern stems from significant loading delays experienced when using the If more specific background on the latency problem would be helpful, I am prepared to provide captures or code snippets that illustrate the issue in more detail. An example or a best practice guide on optimizing Thank you again for your attention to this matter, and I look forward to seeing how the documentation evolves to help developers manage these challenges more effectively. |
What is the improvement or update you wish to see?
I've encountered a lack of documentation regarding the
auth()
method within the Auth.js for Next-Auth. The specific section can be referenced here: Auth.js Method Documentation.Is there any context that might help us understand?
Context and Problem
In implementing a social login feature (Google OAuth) on the top navigation bar of a client component, I utilized the
useSession()
hook to verify user authentication status. However, this approach introduced significant latency issues, with scripts likelayout.js
andmain.js
taking upwards of 20 seconds to load. This delay also affects the rendering of the social login button and subsequent content loading.Upon investigating potential authentication methods suitable for client components, I suspect that the issue might stem from how
useSession()
is implemented within the Next.js app router. I am seeking clarification on whyuseSession()
may be causing such delays and detailed guidance on the correct usage of theauth()
method in client components.Suggested Improvement
It would be beneficial for the Next-Auth documentation to include:
Detailed examples and use cases for the
auth()
method, especially in scenarios involving client components.Explanation of potential performance impacts when using methods like
useSession()
and best practices to mitigate such issues.Thank you for considering this request to enhance the Next-Auth documentation. I believe these additions will greatly assist developers in implementing efficient and effective authentication strategies in their Next.js applications.
Does the docs page already exist? Please link to it.
No response
The text was updated successfully, but these errors were encountered: