Documentation Gap for auth()
Method in Next-Auth
#10562
Labels
documentation
Relates to documentation
auth()
Method in Next-Auth
#10562
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: