I've searched google and youtube for a short and concise explanation but your video is the only one. You have a quick explanation followed by an easy example. Thank you.
T'est aux top guillaume !@@codewithguillaume Des petite formation de clone de projet sur next.js + prisma en Francais ou Anglais comme fait @codewithantonio J'achete direct ^^
nice video well explained. my problem now is am trying to access session via middleware to know if session has been created and the only way a session is created is if the user authenticate successfully. just like you were able to access cookie via middleware, how can I access session via middleware
how can i specfified several middlewares in the same middleware.ts file? each one with its own matchers object and what is the way to one middleware takes preference over others?
Hey Guillaume! Big thanks for your tutorials 😍 One question, I created an NodeJS Backend which provides a REST API, including an endpoint for authenticating user logins. If a user is authenticated, he gets a JWT which contains data "userType" and "expDate". Based on this userType (admin, management, regular) i will render different layout with different functionality. An admin has different access to the Backend Endpoint than a management user and so on. Is this the right way to handle this with middlewares in NextJS? Best :)
Hi!, I'm using NextAuth and they provide a basic middleware like this: export { default } from "next-auth/middleware" export const config = { matcher: ["/dashboard"] } But what if I want to use my own login in my middleware before using NextAuth? I'm having a hard time trying to use more than one middleware in many cases
Hey Good Morning, i got your video. i feel this is basic, for fresh its good, but i struck. 1. How should i use this middle ware through API and UI i have like the URLs : eg : - / , /user , /employer so here after root ( / ), i got JWT token right. so here after that i want to protect all the URL and how should i get the JWT and extract, because i have some values on the JWT, like id and userType. 1. When the URL navigation and allow by this userType. 2. I saw this is run before all the apis run. can you please sort this ?
I tried matching nested routes and it didn't work 😿 export const config = { matcher: [ "/profile", "/profile/edit", "/profile/followers", "/profile/followings", ], }; Do you know why?
El pvto problema que tenia era la pinche ubicacion del archivo, casi me retracto de seguir con el proyecto por esta estupidez, debo calmarme, gracias bro
I've searched google and youtube for a short and concise explanation but your video is the only one. You have a quick explanation followed by an easy example. Thank you.
Thank you my friend ❤️
Man, you are the source of the truth. I hope you upload a video every day or two because I rely on your lessons greatly
❤️❤️ thanks my friend I’ll continue !
T'est aux top guillaume !@@codewithguillaume
Des petite formation de clone de projet sur next.js + prisma en Francais ou Anglais comme fait @codewithantonio J'achete direct ^^
Glad i found your videos on this topic)) Thanks!
Is it possible to have mutliple middleware files with different configs?
simple and short thank you
Thanks my friend
nice video well explained. my problem now is am trying to access session via middleware to know if session has been created and the only way a session is created is if the user authenticate successfully. just like you were able to access cookie via middleware, how can I access session via middleware
Wow, amazing video, everything was explained and I could understand next Middleware, thanks!
Thanks Luis!
Very helpful i am looking for tutorial for fonts in nextjs and i am back to your playlist looking for middleware
Check my playlist !
how can i specfified several middlewares in the same middleware.ts file? each one with its own matchers object and what is the way to one middleware takes preference over others?
Filter through JS code
Reminds me of hooks in Sveltekit!
how can make multi middlewere in sepeate files ?
Thanks a lot for nice video. With the middleware, May we be able set expiration cookies? If yes, How?
Hi sir, can you please tell which version of nextauth is used in the video? And btw very quality vid
Hey man, great video! Have you ever faced issues handling /_next/images routes? My middleware is not triggering these routes
Hey Guillaume! Big thanks for your tutorials 😍
One question, I created an NodeJS Backend which provides a REST API, including an endpoint for authenticating user logins. If a user is authenticated, he gets a JWT which contains data "userType" and "expDate". Based on this userType (admin, management, regular) i will render different layout with different functionality. An admin has different access to the Backend Endpoint than a management user and so on.
Is this the right way to handle this with middlewares in NextJS?
Best :)
It seems to be a good way, yes. But it’s always good to separate admin apps from clients app 😉 a differents apps is always better !
Is anyone able to cache an API call and fetch it from Middleware? Tried server action and proxy but it didn't work correctly
How call database from middleware function, for check user exists ?
Hi!, I'm using NextAuth and they provide a basic middleware like this:
export { default } from "next-auth/middleware"
export const config = { matcher: ["/dashboard"] }
But what if I want to use my own login in my middleware before using NextAuth?
I'm having a hard time trying to use more than one middleware in many cases
Hey Good Morning, i got your video. i feel this is basic, for fresh its good, but i struck.
1. How should i use this middle ware through API and UI
i have like the URLs :
eg : -
/ , /user , /employer
so here after root ( / ), i got JWT token right. so here after that i want to protect all the URL and how should i get the JWT and extract, because i have some values on the JWT, like id and userType.
1. When the URL navigation and allow by this userType.
2. I saw this is run before all the apis run. can you please sort this ?
Excelent video!👍
How do i actually verify auth in middleware i have my auth in my useSession
Check my latest video on sessions
And middleware
how i can add middlewares to api end points like validation middleware in express
merci pour la vidéo 👌✨
I tried matching nested routes and it didn't work 😿
export const config = {
matcher: [
"/profile",
"/profile/edit",
"/profile/followers",
"/profile/followings",
],
};
Do you know why?
THIS GONNA WORKS:
export const config = {
matcher: [
"/profile",
"profile/:path"
],
};
i dont like next.js because when trying to solve a problem you find it difficult to solve or to carry out a specific task i rather stick with React
Next.js = react 😉
El pvto problema que tenia era la pinche ubicacion del archivo, casi me retracto de seguir con el proyecto por esta estupidez, debo calmarme, gracias bro