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
So far this has been the best solution I have been able to do.
I need something to protect the private components, I created a private layout that does the validation. And yes, it will always be necessary to pass the session.
And being on a private route without being logged in just showing an "access denied" message and something that bothers you. The user should be redirected and never be there.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
So far this has been the best solution I have been able to do.
I need something to protect the private components, I created a private layout that does the validation. And yes, it will always be necessary to pass the session.
And being on a private route without being logged in just showing an "access denied" message and something that bothers you. The user should be redirected and never be there.
_app.js
dashboard.js
private.js
I tried an approach with HOC and validating on getInitialProps, however, my pages are not static and I need getStaticProps or getServerSideProps.
(vercel/next.js#20883)
I accept tips or suggestions.
Or if this path is really valid.
Beta Was this translation helpful? Give feedback.
All reactions