Authentication and Route Protection in Nextjs using Higher Order Functions

preview_player
Показать описание
A simple Higher Order Function that handles authentication for any routes in Nextjs. This is a similar approach to HOCs in React. This Higher Order Function can wrap around a GetServerSideProps and protect any route in Nextjs.

Get in touch with me!
Рекомендации по теме
Комментарии
Автор

Make sure to check how I have used it in a Project, there is a link in description. I am here to help as always!

itsfzt
Автор

Works very fine with Nextjs on JS base

aurelmark
Автор

is it working on the dynamic routes? I tried this approach but its not working for me.

kennethpole
Автор

cant I use axios call on requireAuthentican file??

callmehurt
Автор

Amazing video.
Exactly what I was looking for

umarmuhammadzakari
Автор

Nice video it helped me a lot!
I have a question, what if user sets a cookie, will he get access to the protected addresses? Is there a way to prevent it?

criticalmass
Автор

This worked but then my next app couldn't build again

pawntozy
Автор

"higher order functions" eh...

furetosan