Add Middleware to Routes in Next JS | Protected Routes Using Middleware in Next JS

preview_player
Показать описание
Learn to create middleware in Next JS and how to project routes with example.

Here in this video I have described how you can add middleware and allow authenticated users to visit some URLs while unauthenticated users will still land to login page.

source code link
Рекомендации по теме
Комментарии
Автор

if i have 3 role(admin, member, user) then how can i set protected-route according to the role? ( I'm using firebase auth.)

afu
Автор

what if we dont want to use cookies, i mean my token is stored in localstorage, and i dont want to use cookies, then what is the solution?

faizanahmedsiddiqui
Автор

hey bro I am learning web development. Can you explain what a middleware is?

newagene
Автор

how do this process with access token which stored in local storage..?

SakthiCs
Автор

i have a doubt, the cookies can be edited by the user right, so the user can change the value of the cookies and sign in right

navadeepsatheesh
Автор

What if there are multiple routes suppose there are 20 routes. What to do in that case?

archauhan
Автор

without middleware can we do it manually, creating hoc and wrapping in app.tsx file component page props wrapping any suggestion???

saikrishnamuntha
visit shbcf.ru