Middleware with Next.js 14 - Course part 12

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ม.ค. 2025

ความคิดเห็น • 38

  • @RH-mk3rp
    @RH-mk3rp ปีที่แล้ว +16

    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.

  • @xenos112
    @xenos112 ปีที่แล้ว +2

    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

    • @codewithguillaume
      @codewithguillaume  ปีที่แล้ว +4

      ❤️❤️ thanks my friend I’ll continue !

    • @LostInRaccoonCity
      @LostInRaccoonCity ปีที่แล้ว

      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 ^^

  • @nefed-L
    @nefed-L 3 หลายเดือนก่อน +1

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

  • @violinsheetmusicblog
    @violinsheetmusicblog 10 หลายเดือนก่อน +2

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

  • @napoleongreatson
    @napoleongreatson 11 หลายเดือนก่อน +3

    simple and short thank you

  • @ekenennabugwu4732
    @ekenennabugwu4732 11 หลายเดือนก่อน +1

    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

  • @luis96xd
    @luis96xd ปีที่แล้ว +1

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

  • @HarisMS-xk3jm
    @HarisMS-xk3jm 7 หลายเดือนก่อน +1

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

  • @haroldpepete
    @haroldpepete 11 หลายเดือนก่อน +1

    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?

  • @HONjramiroz98
    @HONjramiroz98 7 หลายเดือนก่อน +1

    Reminds me of hooks in Sveltekit!

  • @omarrayes2281
    @omarrayes2281 3 หลายเดือนก่อน +1

    how can make multi middlewere in sepeate files ?

  • @muhammadijaz6042
    @muhammadijaz6042 4 หลายเดือนก่อน

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

  • @אליה-ז8י
    @אליה-ז8י 5 หลายเดือนก่อน

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

  • @RodrigoMiranda-iw5ll
    @RodrigoMiranda-iw5ll 7 หลายเดือนก่อน

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

  • @saulgodman7872
    @saulgodman7872 ปีที่แล้ว +1

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

    • @codewithguillaume
      @codewithguillaume  ปีที่แล้ว +1

      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 !

  • @zo9fg
    @zo9fg 4 หลายเดือนก่อน

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

  • @protonys
    @protonys 7 หลายเดือนก่อน

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

  • @loo6942
    @loo6942 11 หลายเดือนก่อน

    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

  • @NareshkumarS-u5s
    @NareshkumarS-u5s 4 หลายเดือนก่อน

    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 ?

  • @kkkkkkcelo
    @kkkkkkcelo 8 หลายเดือนก่อน

    Excelent video!👍

  • @ShivaPasunuri-z8e
    @ShivaPasunuri-z8e ปีที่แล้ว +1

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

  • @lava_dev169
    @lava_dev169 ปีที่แล้ว

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

  • @art-sider
    @art-sider 5 หลายเดือนก่อน

    merci pour la vidéo 👌✨

  • @ahmedAltariqi
    @ahmedAltariqi ปีที่แล้ว

    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?

    • @vitorhcaval
      @vitorhcaval 10 หลายเดือนก่อน

      THIS GONNA WORKS:
      export const config = {
      matcher: [
      "/profile",
      "profile/:path"
      ],
      };

  • @aslamiliyas7703
    @aslamiliyas7703 7 หลายเดือนก่อน +1

    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

  • @jeissonwee3736
    @jeissonwee3736 7 หลายเดือนก่อน

    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