Web Dev Cody
Web Dev Cody
  • 916
  • 18 372 705

Відео

Trying to add refresh token logic in next-auth
Переглядів 6 тис.День тому
no lie, next-auth kind of sucks some links to read authjs.dev/guides/refresh-token-rotation github.com/nextauthjs/next-auth-refresh-token-example My Products 🏗️ WDC StarterKit: wdcstarterkit.com ProjectPlannerAI: projectplannerai.com IconGeneratorAI: icongeneratorai.com 📝 ThumbnailCritique: thumbnailcritique.com Useful Links 💬 Discord: discord.gg/4kGbBaa 🔔 Newsletter: newsletter.webdevcody.co...
How I setup role based authorization Next Auth
Переглядів 8 тис.День тому
My Products 🏗️ WDC StarterKit: wdcstarterkit.com ProjectPlannerAI: projectplannerai.com IconGeneratorAI: icongeneratorai.com 📝 ThumbnailCritique: thumbnailcritique.com Useful Links 💬 Discord: discord.gg/4kGbBaa 🔔 Newsletter: newsletter.webdevcody.com/ 📁 GitHub: github.com/webdevcody 📺 Twitch: www.twitch.tv/webdevcody Website: webdevcody.com 🐦 Twitter: webdevcody
How I rate limit without third party services
Переглядів 11 тис.День тому
btw, this rate limiting is built into my starter kit, check it out wdcstarterkit.com My Products 🏗️ WDC StarterKit: wdcstarterkit.com ProjectPlannerAI: projectplannerai.com IconGeneratorAI: icongeneratorai.com 📝 ThumbnailCritique: thumbnailcritique.com Useful Links 💬 Discord: discord.gg/4kGbBaa 🔔 Newsletter: newsletter.webdevcody.com/ 📁 GitHub: github.com/webdevcody 📺 Twitch: www.twitch.tv/we...
My best advice for finishing projects
Переглядів 13 тис.День тому
youtube.com/@anthonygg_ My Products 🏗️ WDC StarterKit: wdcstarterkit.com ProjectPlannerAI: projectplannerai.com IconGeneratorAI: icongeneratorai.com 📝 ThumbnailCritique: thumbnailcritique.com Useful Links 💬 Discord: discord.gg/4kGbBaa 🔔 Newsletter: newsletter.webdevcody.com/ 📁 GitHub: github.com/webdevcody 📺 Twitch: www.twitch.tv/webdevcody Website: webdevcody.com 🐦 Twitter: webd...
I'm definitely using this library for all server actions now
Переглядів 15 тис.День тому
My Products 🏗️ WDC StarterKit: wdcstarterkit.com ProjectPlannerAI: projectplannerai.com IconGeneratorAI: icongeneratorai.com 📝 ThumbnailCritique: thumbnailcritique.com Useful Links 💬 Discord: discord.gg/4kGbBaa 🔔 Newsletter: newsletter.webdevcody.com/ 📁 GitHub: github.com/webdevcody 📺 Twitch: www.twitch.tv/webdevcody Website: webdevcody.com 🐦 Twitter: webdevcody
Adding a create group page to my starter kit (trying out next-safe-action)
Переглядів 3,4 тис.День тому
My Products 🏗️ WDC StarterKit: wdcstarterkit.com ProjectPlannerAI: projectplannerai.com IconGeneratorAI: icongeneratorai.com 📝 ThumbnailCritique: thumbnailcritique.com Useful Links 💬 Discord: discord.gg/4kGbBaa 🔔 Newsletter: newsletter.webdevcody.com/ 📁 GitHub: github.com/webdevcody 📺 Twitch: www.twitch.tv/webdevcody Website: webdevcody.com 🐦 Twitter: webdevcody
How database migrations work when using Drizzle ORM
Переглядів 4,4 тис.День тому
My Products 🏗️ WDC StarterKit: wdcstarterkit.com ProjectPlannerAI: projectplannerai.com IconGeneratorAI: icongeneratorai.com 📝 ThumbnailCritique: thumbnailcritique.com Useful Links 💬 Discord: discord.gg/4kGbBaa 🔔 Newsletter: newsletter.webdevcody.com/ 📁 GitHub: github.com/webdevcody 📺 Twitch: www.twitch.tv/webdevcody Website: webdevcody.com 🐦 Twitter: webdevcody
Adding documentation to your Next.js application is easier than you think
Переглядів 6 тис.14 днів тому
My Products 🏗️ WDC StarterKit: wdcstarterkit.com ProjectPlannerAI: projectplannerai.com IconGeneratorAI: icongeneratorai.com 📝 ThumbnailCritique: thumbnailcritique.com Useful Links 💬 Discord: discord.gg/4kGbBaa 🔔 Newsletter: newsletter.webdevcody.com/ 📁 GitHub: github.com/webdevcody 📺 Twitch: www.twitch.tv/webdevcody Website: webdevcody.com 🐦 Twitter: webdevcody
How to create conditional headers in nextjs
Переглядів 5 тис.14 днів тому
My Products ProjectPlannerAI: projectplannerai.com IconGeneratorAI: icongeneratorai.com 📝 ThumbnailCritique: thumbnailcritique.com Useful Links 💬 Discord: discord.gg/4kGbBaa 🔔 Newsletter: newsletter.webdevcody.com/ 📁 GitHub: github.com/webdevcody 📺 Twitch: www.twitch.tv/webdevcody Website: webdevcody.com 🐦 Twitter: webdevcody
How to paywall 💰 a private github repo
Переглядів 6 тис.14 днів тому
My Products ProjectPlannerAI: projectplannerai.com IconGeneratorAI: icongeneratorai.com 📝 ThumbnailCritique: thumbnailcritique.com Useful Links 💬 Discord: discord.gg/4kGbBaa 🔔 Newsletter: newsletter.webdevcody.com/ 📁 GitHub: github.com/webdevcody 📺 Twitch: www.twitch.tv/webdevcody Website: webdevcody.com 🐦 Twitter: webdevcody
Next.js MDX is pretty awesome
Переглядів 8 тис.14 днів тому
My Products ProjectPlannerAI: projectplannerai.com IconGeneratorAI: icongeneratorai.com 📝 ThumbnailCritique: thumbnailcritique.com Useful Links 💬 Discord: discord.gg/4kGbBaa 🔔 Newsletter: newsletter.webdevcody.com/ 📁 GitHub: github.com/webdevcody 📺 Twitch: www.twitch.tv/webdevcody Website: webdevcody.com 🐦 Twitter: webdevcody
How I implemented drag and drop for re-ordering lists in Next.js
Переглядів 8 тис.21 день тому
github.com/hello-pangea/dnd My Products ProjectPlannerAI: projectplannerai.com IconGeneratorAI: icongeneratorai.com 📝 ThumbnailCritique: thumbnailcritique.com Useful Links 💬 Discord: discord.gg/4kGbBaa 🔔 Newsletter: newsletter.webdevcody.com/ 📁 GitHub: github.com/webdevcody 📺 Twitch: www.twitch.tv/webdevcody Website: webdevcody.com 🐦 Twitter: webdevcody
Writing Cron Jobs Just Became Fun Again
Переглядів 10 тис.21 день тому
Be sure to checkout convex.dev/c/wdc which is the sponsor of this video, and convex is the backend as a service I use for project planner ai. I highly recommend trying it out! My Products ProjectPlannerAI: projectplannerai.com IconGeneratorAI: icongeneratorai.com 📝 ThumbnailCritique: thumbnailcritique.com Useful Links 💬 Discord: discord.gg/4kGbBaa 🔔 Newsletter: newsletter.webdevcody.com/ 📁 Gi...
No GPT4 subscription? Try this alternative GPT interface
Переглядів 8 тис.21 день тому
No GPT4 subscription? Try this alternative GPT interface
The coolest Next.js feature I haven't used until now
Переглядів 13 тис.21 день тому
The coolest Next.js feature I haven't used until now
This might be the most configurable rich text editor for next.js
Переглядів 11 тис.21 день тому
This might be the most configurable rich text editor for next.js
This MacOS app makes coding on my laptop fun again!
Переглядів 10 тис.21 день тому
This MacOS app makes coding on my laptop fun again!
Stop using typescript env variables wrong
Переглядів 10 тис.Місяць тому
Stop using typescript env variables wrong
This tool makes self hosting simple
Переглядів 48 тис.Місяць тому
This tool makes self hosting simple
Web creation platforms are better than I thought
Переглядів 6 тис.Місяць тому
Web creation platforms are better than I thought
This is why you need infrastructure as code tooling (Terraform with AWS provider overview)
Переглядів 11 тис.Місяць тому
This is why you need infrastructure as code tooling (Terraform with AWS provider overview)
My favorite component library is unstoppable
Переглядів 20 тис.Місяць тому
My favorite component library is unstoppable
We added a feedback API to our application
Переглядів 8 тис.Місяць тому
We added a feedback API to our application
Cloudflare tunnels are pretty cool
Переглядів 25 тис.Місяць тому
Cloudflare tunnels are pretty cool
I'm now VPS red pilled (and protecting with CloudFlare)
Переглядів 30 тис.Місяць тому
I'm now VPS red pilled (and protecting with CloudFlare)
I got my first DDoS (and what you can do to help prevent it)
Переглядів 33 тис.Місяць тому
I got my first DDoS (and what you can do to help prevent it)
Build a Pair Programming Finder with Video & Screen Share (Next.js, Shadcn, Tailwind, Typescript)
Переглядів 50 тис.Місяць тому
Build a Pair Programming Finder with Video & Screen Share (Next.js, Shadcn, Tailwind, Typescript)
AstroDB might be the easiest SQL setup you can get
Переглядів 11 тис.2 місяці тому
AstroDB might be the easiest SQL setup you can get
These are the code quality checks we do in our production system
Переглядів 15 тис.2 місяці тому
These are the code quality checks we do in our production system

КОМЕНТАРІ

  • @0x3334
    @0x3334 12 годин тому

    When I stumbled on this exact situation, I thought I was losing my mind. I eventually reached the same conclusions as you, and I ended up just using token strategy for things like /admin access (protected routes), then check more granular permissions downstream.

  • @Dom-zy1qy
    @Dom-zy1qy 13 годин тому

    You guys are still using next auth? Previous auth is where it's at.

  • @runners4tme
    @runners4tme 13 годин тому

    Where does layout get rendered? Is it only the client or server or both?

  • @i-see-right-through-you
    @i-see-right-through-you 14 годин тому

    Cody's advise near the end takes "testing in production" to a new level.

  • @yipmong
    @yipmong 14 годин тому

    Your videos are helpful, Thanks alot❤ deserved a Sub🎉🎉

  • @EusebioResende
    @EusebioResende 15 годин тому

    Smells like Vendor Lock to me.

  • @andy_jojo01
    @andy_jojo01 15 годин тому

    Please, code

  • @buddy.abc123
    @buddy.abc123 15 годин тому

    Which is why going into 2025 we don't use JavaScript on the server

  • @hamoodrex
    @hamoodrex 15 годин тому

    What's your opinion on selling a saas that is built as lets say dockerized instances for each customer vs having one system with multitenancy approach? I started with a multitenant approach and realized that it gets more complex as having one database with tenant_Ids everywhere. Also when it comes to logging and dashboard usage, I would like to tell which customer is doing what on which system. But the thing I like with the tenant approach is that getting a payment and setting it up can be easy for the customer and then you have the ability to switch between tenants which is something i've seen on another software. Keep in mind. I am leaning towards getting rid of the multitenant system just in case a customer asks for an on-premise solution.

  • @flnnx
    @flnnx 16 годин тому

    That was really helpful!

  • @HichamKazan
    @HichamKazan 16 годин тому

    you can filter your pathnames that pass through the middleware by using the exported config object also I tend to do the pattern you mentioned of doing ifs on the pathname for specific cases

  • @saidalachgar8837
    @saidalachgar8837 17 годин тому

    we need this site live! it's amazing

  • @WebDevCodeCrush
    @WebDevCodeCrush 17 годин тому

    I’ve struggled with this as well. Not really sure what best practices might be, but at this point I just do a basic access check in middleware for admin routes or user routes to check for authentication. This at least protects my sensitive route groups, but then I do a fine grained authorization on page level for access control. Not ideal, but works.

  • @HarshDoes
    @HarshDoes 18 годин тому

    At this point, I just hate Next.js. Just using MERN stack does the job for me.

  • @ShivGamer
    @ShivGamer 18 годин тому

    I always get confused with Auth, please make a tutorial on Next auth once you figure it out😂

  • @IshworGiri1999
    @IshworGiri1999 18 годин тому

    you can probably use auth() function from v5 and see if this works

  • @ericdd3329
    @ericdd3329 18 годин тому

    because nextjs doesn't give you an actual middleware, in a nodejs app you expect the middleware to be the same, simple and incredibly useful one that was using app.use in express but because of all of this caching bs they make it impossible to make dynamic responses based on data that can change, it's pretty stupid and they should give an option to disable all the caching bs with one config command.

  • @ehsanrezaee4910
    @ehsanrezaee4910 18 годин тому

    i have the same problem with Crypto module of node js in middleware. i was using JWT package in the middleware and JWT uses crypto module of node js. so i ran into the same issue when try to use Turbopack. i opened issue 64464 and mentioned the problem. Tim Neutkins commented on the issue and fixed it. so in the canary version 14.3.0 the issue has been resolved.

  • @zivtamary
    @zivtamary 18 годин тому

    wdym token set for 30 days? you can manually change the cookie age on the auth config and everytime session is called the jwt is refreshed

    • @WebDevCody
      @WebDevCody 18 годин тому

      I honestly don’t remember what I said about 30 days. Yeah you can reduce the session max age in the next auth config.

  • @shahzaibshahzaibkhan6480
    @shahzaibshahzaibkhan6480 18 годин тому

    Didn't use next-auth but I had to use firebase auth with Next.js Middleware, and there was a package that saved my ass called next-firebase-auth-edge, but even that was kinda complicated to set up, especially on the frontend.

  • @tevoj
    @tevoj 18 годин тому

    I used drizzle and I hated :(.

    • @SirMeowMeow
      @SirMeowMeow 16 годин тому

      Drizzle is extremely under-documented at the moment. I'd wait unless you like being early. I'd write a tutorial but it'll likely go out of date in a single month.

  • @Happyday-nn6rh
    @Happyday-nn6rh 19 годин тому

    can use it for jwt strategy ? session: { strategy: "jwt", maxAge: 30 * 24 * 60 * 60, updateAge: 24 * 60 * 60, },

  • @mattd5419
    @mattd5419 19 годин тому

    The solution should be pretty easy, although not much elegant! you could just fetch the session like this: await fetch(`${req.nextUrl.origin}/api/auth/session`, { headers: { cookie: req.headers.get("cookie") || "", }, })

  • @justanaveragebalkan
    @justanaveragebalkan 19 годин тому

    If only angular existed. { path: "dashboard", component: DashboardComponent, canActivate: [() => authenticationGuard()], } My biggest gripe with anything react based is everyone tries to invent his own shitty version of what should be a standard part of the library. Angular much better, each project has a clear defined structure, yes ng-for ect ect was really annoying but it's no longer a thing, since 17 i do think it's much better than any react based "framework" out there.

  • @d-mathieucosyns
    @d-mathieucosyns 19 годин тому

    Your middleware file should export a config with a matcher pattern to not be called with every file request. Just like in nextjs docs. export const config = { matcher: [ /* * Match all request paths except for the ones starting with: * - api (API routes) * - _next/static (static files) * - _next/image (image optimization files) * - favicon.ico (favicon file) */ '/((?!api|_next/static|_next/image|favicon.ico).*)', ], }

  • @lord_kh4n
    @lord_kh4n 19 годин тому

    Hey Cody, noob question here, does this mean that the middleware won't run on VPS anymore? or it's just can't run some packages on middleware?

    • @WebDevCody
      @WebDevCody 19 годин тому

      It just means every package you use must be edge compliant even if you don’t run in edge

  • @developerpranav
    @developerpranav 19 годин тому

    Also relying on authorization checks in layouts isn't gonna be 100% secure. You can request an RSC payload by just adding a search param and it can return the children of layout (Page.tsx in this instance) without even executing layout.tsx Auth checks in page.tsx are unreliable in the same fashion. sources: ua-cam.com/video/EGDD0rlBd8Q/v-deo.html ua-cam.com/video/v6UvgfSIjQ0/v-deo.html

    • @WebDevCody
      @WebDevCody 19 годин тому

      I’m not sure what you mean. If you run an auth check in page.tsx, no user should be able to see the page unless they have access. Am I missing something?

    • @developerpranav
      @developerpranav 17 годин тому

      @@WebDevCody That's right, my bad. what you mentioned is most likely is the behaviour with page.tsx

  • @dkr91
    @dkr91 19 годин тому

    What about opennext?

    • @WebDevCody
      @WebDevCody 19 годин тому

      Probably the same issue, you must use edge compliant packages in middleware or next won’t build

  • @hareshwedanayake7427
    @hareshwedanayake7427 19 годин тому

    I was so stuck on this issue. Thank you so much!!!

  • @developerpranav
    @developerpranav 19 годин тому

    that "additional plugins required to handle cloudflare: URIs" error is due to pg not working well on the edge runtime (which the next.js middleware runs on). If you move to something like neon or @vercel/pg (also works with supabase), which uses HTTP to connect to the db, it works just fine. otherwise there's a weird webpack override that you can set in next.config.js but that doesn't seem to work anymore on Next 14.1 and above?

    • @WebDevCody
      @WebDevCody 19 годин тому

      Yes, my complaint is i shouldn’t have to use a third party service to talk to my database. This is a dumb constraint added to a framework which feels like a vercel only feature

    • @developerpranav
      @developerpranav 18 годин тому

      @@WebDevCody agreed. wonder if setting `export const runtime = 'nodejs'` works on middleware 🤔

  • @AvisekDas
    @AvisekDas 19 годин тому

    @WebDevCody React query can fix this problem. Vanilla NextJS with server actions and revalidatePath is not always the complete solution.

  • @griffadev
    @griffadev 19 годин тому

    Another shitty thing about next middleware is you only have one middleware file. Youd expect it to work at every point you can add a page

    • @WebDevCody
      @WebDevCody 19 годин тому

      Agreed. It should act like layout.tsx

  • @darespvpmc
    @darespvpmc 19 годин тому

    I have a problem with the minecraft server hosting project I am trying to practice but when I run the agent it gives me an error and I can only run the client please help thanks

  • @darespvpmc
    @darespvpmc 19 годин тому

    I have a problem with the minecraft server hosting project I am trying to practice but when I run the agent it gives me an error and I can only run the client please help thanks

  • @brxve
    @brxve 19 годин тому

    Yes, this is not next-auth related issue. Idk why tons of ppl think this way, it happens on anything if you are using non-supported node packages on Edge Runtime. A workaround to fix this is, you can use your API inside middlewares. Instead of using await getCurrentUser() directly, have an API endpoint that returns that so you can use fetch to get this data.

  • @tommmywoh
    @tommmywoh 20 годин тому

    You could try using the neon serverless driver with the neon drizzle adapter. That's my current setup to query Supabase from Drizzle Neon in Nextjs middlewares/routes hosted on cloudflare

    • @WebDevCody
      @WebDevCody 19 годин тому

      I think those require your database be hosted behind a service with http access. I should be able to query my database directly like any type of backend imo

  • @gadgetboyplaysmc
    @gadgetboyplaysmc 20 годин тому

    I use Vike

    • @emmanuelezeagwula7436
      @emmanuelezeagwula7436 19 годин тому

      what do you to think about it ? how is the dev experience ? Can I build fullstack apps with it

    • @gadgetboyplaysmc
      @gadgetboyplaysmc 17 годин тому

      ​@@emmanuelezeagwula7436 Yes you definitely can. It definitely doesn't have the pitfalls I run into with NextJS. Since you're asking, let me give you a long ass review of it: Vike technically bundled by Vite so it's like A LOT faster than Next's scuffed Turbopack + Webpack bundling right now. In my personal experience. Developing feels so fast. 100% Turbopack doesn't feel like ever coming and even if it does, Vite is fast enough for me to care. Frontend: You can use literally any JS framework with it. Solid, Svelte, React, etc. Personally use it with Solid because Start is in RC atm. Backend: It's just a middleware so you can run it on any backend (Hono, H3, Fastify, etc.) Also heads-up, unlike Next, Vike doesn't have `/api/*` routes by default. So if you run a project with just Vike, it's technically just an html-renderer in JavaScript without the /api or GET/POST/PUT/DELETE routes. When you do attach it to your own backend, that's when you can replicate that "/api" route feature that Next has.--I personally also like this because I don't have to write my APIs in the "NextJS" paradigm. I can organize my routes and add my middlewares specific to my framework. Besides that, it does its job super well and there's definitely some good engineering behind it. I've used it quite extensively. There's definitely a lot more boilerplate in the beginning but it does become pretty organized in the long-run. The flexibility you can have with it is awesome. You really just have to try it out to know it's good. But it's definitely not for everyone, I just prefer it at this point. If you want comparisons: personally can compare it to SvelteKit and Remix. The file routing system is very similar to Next and SvelteKit, but more similar to SvelteKit because of `+Page` prefix and separation of server load functions into `+data`, it feels more organized. + it's actually typesafe. I also compare it to Remix because Remix is also taking the same approach of "just a middleware" and can run in any JS backend + Vite. But Remix is more "React", and I don't use React anymore :D

  • @kyrregjerstad
    @kyrregjerstad 20 годин тому

    I had the same issue not too long ago. I ended up creating an API endpoint which takes care of the db call, and then calling that from the middleware. Not the prettiest solution, but it worked 🤷‍♂

  • @DiiiaZoTe
    @DiiiaZoTe 20 годин тому

    This had to do with the middleware being configured to run on the edge only. I personally use Lucia auth with database sessions and use Drizzle with a MySQL database deployed on my server. The middleware does not allow me to query the DB at all to validate the session because of this edge/node issue. Also at 6:37, I would not recommend doing auth checks or get the user in the layout but rather in a template. The reasoning behind that is that the layout won't be triggered again on client routing between pages. A template will retrigger getting the user or validating the user to make sure it's up to date.

    • @WebDevCody
      @WebDevCody 19 годин тому

      What do you mean by template? Honestly any time data comes back from the database I run an auth check to verify the user should have access to see that data

    • @Xapyion
      @Xapyion 16 годин тому

      Are you talking about the template.tsx file?

    • @DiiiaZoTe
      @DiiiaZoTe 14 годин тому

      @@WebDevCody Correct, the template.tsx is better than layout.tsx for verifying user has access and redirect if needed. Technically, the layout should be enough but if you want to make sure that the validation happens for every route, then template.tsx should run the check from what I understand. Or do it inside each page.tsx Hell, I sometimes do it in all... My get user function does validation too so I wrap it with the cache function provided by react to optimize and voila. It will only process once.

  • @darespvpmc
    @darespvpmc 20 годин тому

    cool video. I have a problem with the minecraft server hosting project I am trying to practice but when I run the agent it gives me an error and I can only run the client please help thanks

  • @PraiseYeezus
    @PraiseYeezus 20 годин тому

    Next.js is way, way too coupled to Vercel's opinionated deployment strategies. I don't mind if a framework is opinionated; that usually just means there's a defacto "right way" to do anything you'd need to. But how on God's green earth does it make sense for a Node-based framework to ONLY allow "edge-friendly" libraries...? You'd think they'd have a config option to allow you to opt INTO an edge-based middleware...but since Next is designed to be deployed to Vercel I guess it's not a priority. I've been getting more and more frustrated with Next lately, I hope a new stable RSC-framework arrives soon but maybe that's unrealistic.

  • @realbigsquid
    @realbigsquid 20 годин тому

    I have had the same issues with nextauth, I feel like the Middleware is more hassle than it's worth lol

  • @yoz0__
    @yoz0__ 20 годин тому

    Time to move to Remix/Nuxt.

  • @neociber24
    @neociber24 20 годин тому

    I got the same problem, my dirty workaround was to proxy the database calls with a secret key. Checkout the proxy section in drizzle docs for Postgres.

    • @neociber24
      @neociber24 20 годин тому

      It's that or using a framework with ACTUAL middlewares like Sveltekit, or use NextJS being a express server and add the middleware there.

  • @brad7r
    @brad7r 21 годину тому

    All the abstraction and inability to control your code at the right level is why I don’t bother with next anymore.

  • @ExileEditing
    @ExileEditing 21 годину тому

    You can use the middleware matcher from clerk here to run everywhere except static files to prevent that many session calls but it may still do a few more than expected

  • @rand0mtv660
    @rand0mtv660 21 годину тому

    I've tried using next-auth few times and I never had a good experience. Bad docs and cryptic errors all the time. Managed to get it working, but left a bad impression. I usually work on projects where backend is separate from the Next.js app so in middleware I don't have these issues because I just ping an external API for all this session information and don't need next-auth at all really. Regarding 4:50 and middleware running on all requests, that's mentioned in docs and there is a "matcher" config you can specify to ignore api routes, static files etc. We developers need to learn to read docs better because I also jump into stuff immediately without actually reading few paragraphs first. As far as edge goes, I think Vercel just went in too deep into that with Next.js and it's causing a frustrating experience. Even they are stepping back from some of the ideas they have been pushing and admitted they were wrong, which is good.

  • @Sledgeattack
    @Sledgeattack 21 годину тому

    From my experience there is no way to make NextAuth play nice with Edge Middleware, I have no idea why they coupled "Middleware" the programming pattern to Edge-Middleware the microservice. It feels like such a massive, hopefully unintentional, design flaw to not just have both and have them be different things. If I want some micro-service to run, possibly closer to the user, before my requests, have that be one thing and then you can have a function that runs before my requests on the same deployment be another thing. What I ended up doing with next-auth and edge middleware was just checking if the request had a next-auth cookie, that way I didn't have to include the library in the middleware microservice, but I was in the same situation were I was deploying to a company's internal Kubernetes environment and there was no reason for me to deploy my middleware as a microservice with a different runtime.

  • @domson_0478
    @domson_0478 21 годину тому

    Middleware is only for edge runtime right now

  • @Tanner-cz4bd
    @Tanner-cz4bd 21 годину тому

    Try clerk or lucia auth