getProviders should be callable from a server component #9914
pippinmole
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Goals
getProviders()
fromnext-auth/react
to be used server side.Non-Goals
No response
Background
Currently, you are forced to use
getProviders
client-side through by either:getServerSideProps
(which isn't applicable to app router)use()
API like so:const providers = use(getProviders())
useEffect
I think we should be able to use this function server side to reduce the 'time-to-providers'. I don't see why a login page has to asynchronously load in the providers on the client side.
Proposal
Allow for this syntax:
currently, if you try to render this component, you'll get this error:
this is of course expected, since the function isn't exported in any way to the server build.
Beta Was this translation helpful? Give feedback.
All reactions