Middleware with Next.js 14 — Course part 12

preview_player
Показать описание

Thanks for watching! Please subscribe ❤️

Guillaume

👇

Read my adventures

Join my Discord

Book a coaching

Looking for a repository?

Visit my website

Install my package UserItem

💥 TOP VIDEOS

Learn Nuxt

Learn Nextjs

Learn Supabase

⚙️

• Theme that I use: VSCode Dark
• Snippets: my own, coming soon :)

Thank you :)

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

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.

RH-mkrp
Автор

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

AIZEN
Автор

Glad i found your videos on this topic)) Thanks!

nefed-L
Автор

Is it possible to have mutliple middleware files with different configs?

violinsheetmusicblog
Автор

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

ekenennabugwu
Автор

Very helpful i am looking for tutorial for fonts in nextjs and i am back to your playlist looking for middleware

HarisMS-xkjm
Автор

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?

haroldpepete
Автор

Thanks a lot for nice video. With the middleware, May we be able set expiration cookies? If yes, How?

muhammadijaz
Автор

how can make multi middlewere in sepeate files ?

omarrayes
Автор

Wow, amazing video, everything was explained and I could understand next Middleware, thanks!

luisxd
Автор

Hi sir, can you please tell which version of nextauth is used in the video? And btw very quality vid

אליה-זי
Автор

How call database from middleware function, for check user exists ?

protonys
Автор

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 :)

saulgodman
Автор

Is anyone able to cache an API call and fetch it from Middleware? Tried server action and proxy but it didn't work correctly

zofg
Автор

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

loo
Автор

Hey man, great video! Have you ever faced issues handling /_next/images routes? My middleware is not triggering these routes

RodrigoMiranda-iwll
Автор

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 ?

NareshkumarS-us
Автор

how i can add middlewares to api end points like validation middleware in express

lava_dev
Автор

How do i actually verify auth in middleware i have my auth in my useSession

ShivaPasunuri-ze
Автор

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?

ahmedAltariqi