You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently, when using withPasswordProtect() the initial render will always be "return null".
Only after the API call, the App is rendered. No matter if you are already logged in or not. This means when you are working with SSR/pages using getServerSideProps(), you can't verify that the HTML response is correct and that hydration will work in production.
Describe the solution you'd like
In theory, it should be possible to check the cookie and verify the session inside getServerSideProps().
Maybe an API could be added to perform the check in getServerSideProps() and pass the value of isAuthenticated to the ProtectedApp.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Currently, when using
withPasswordProtect()
the initial render will always be "return null".https://github.com/storyofams/next-password-protect/blob/93c7ae7ead3a1322a642d02ed127fb0c85689207/src/hoc/withPasswordProtect.tsx#L53-L55
Only after the API call, the App is rendered. No matter if you are already logged in or not. This means when you are working with SSR/pages using getServerSideProps(), you can't verify that the HTML response is correct and that hydration will work in production.
Describe the solution you'd like
In theory, it should be possible to check the cookie and verify the session inside
getServerSideProps()
.Maybe an API could be added to perform the check in getServerSideProps() and pass the value of
isAuthenticated
to theProtectedApp
.The text was updated successfully, but these errors were encountered: