-
Notifications
You must be signed in to change notification settings - Fork 288
Open
Labels
RFCRequest for comments and ideasRequest for comments and ideasenhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
Next.js supports middleware, which this library could recommend as a way to integrate with next-firebase-auth
. I'd like to gather input on whether middleware provides value that the current API (withAuthUser
and withAuthUserTokenSSR
) does not.
My initial assessment is that middleware usage could be a good option for apps where auth info is needed on many or all pages and the server-side auth/redirect settings don't change between pages. In this scenario, middleware could provide an AuthUser on the request object in getServerSideProps
or redirect as needed.
However:
- Middleware can't currently set return data or set React context; thus, unlike the existing API for SSR pages, AuthUser won't be set on the client side until the Firebase JS SDK initializes.
- Middleware reduces flexibility on whether to use auth info on individual pages.
Feedback and input appreciated!
trymbill, ahetawal-p, luiz504 and moy2010
Metadata
Metadata
Assignees
Labels
RFCRequest for comments and ideasRequest for comments and ideasenhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed