Lucia Auth Role Based Protected Route - Lucia auth Next js, PostgreSQL, Typescript, Drizzle ORM

Поделиться
HTML-код
  • Опубликовано: 2 июн 2024
  • In this video I have implemented a protected route for only specific role. It was pretty easy.
    Source code available on:
    github.com/ugurkellecioglu/ne...

Комментарии • 33

  • @kuba6547
    @kuba6547 2 месяца назад +2

    Wow ! I was about to ask about it :D Thanks Ugur !

    • @ugurcodes
      @ugurcodes  2 месяца назад +1

      Haha:D that's awesome :D let me know if you have other things you'd like to see. I'd like to record video about them :) thanks!

    • @kuba6547
      @kuba6547 2 месяца назад

      Maybe some examples of building relations between different models with DrizzleORM (ForeignKeys, etc). I'm doing a prototype of time-tracking app with role based authentication on this stack: Lucia / PostgreSQL / Drizzle / Next.14 / TypeScript and Your content was very helpful so far :) @@ugurcodes

  • @kingjune6685
    @kingjune6685 2 месяца назад +1

    great content! I think a video demonstrating how to use middleware for redirection in Next.js with Lucia would be incredibly useful. It'd help many understand the benefits of centralized redirection logic, particularly for larger projects. Looking forward to possibly seeing this!

    • @ugurcodes
      @ugurcodes  2 месяца назад

      author of Lucia Auth, don't recommend using middleware. you can check out this article: pilcrowonpaper.com/blog/middleware-auth/

  • @whezboo
    @whezboo 2 месяца назад +1

    You've made me hit the subscribe button

  • @larrymcfarlane6202
    @larrymcfarlane6202 2 месяца назад +1

    HI Ugur Codes, I've found your videos to be very helpful with both Lucia and Drizzle. I've also been wondering about a Redis alternative and you have that in one of your videos! Awesome work!

    • @ugurcodes
      @ugurcodes  2 месяца назад

      Hi! thank you so much, you made my day :)

  • @TheMERABANABER
    @TheMERABANABER 2 месяца назад +1

    I love these videos Uğur thank you so much, lucia definitely needs video tutorials

    • @ugurcodes
      @ugurcodes  2 месяца назад

      Thank you so much 😊 these comments make me really happy!

  • @qualifyernst4576
    @qualifyernst4576 20 дней назад +1

    Can Lucia be used in a MERN stack, if it can, please do a tutorial

  • @skverskk
    @skverskk Час назад

    Nice!! Couldn't this be implemented in a middleware file?

  • @carloscespedes495
    @carloscespedes495 Месяц назад +1

    can you create something with roles and permissions please either from scratch or with a library called casl js for creating permissions and assigning them to each user, this is much more scalable than just roles please.

  • @madebyjonny7637
    @madebyjonny7637 2 месяца назад +1

    Great video!

  • @mrigankagogoi6262
    @mrigankagogoi6262 2 месяца назад +2

    Can you share some tips on how to get started in upwork. Since you are a top rated developer in upwork your guidance will really help to get started in upwork.

    • @ugurcodes
      @ugurcodes  2 месяца назад +2

      I'd be glad to record video around freelancing but I'm not sure if people would watch it

    • @ariburaco
      @ariburaco 2 месяца назад

      They would watch 👍

    • @lev1ato
      @lev1ato 2 месяца назад +1

      I also thought about asking for a video about it, I am definitely interested as well @ugurcodes 🙏

  • @simonhblanco
    @simonhblanco 2 месяца назад +1

    excelent and simple!! thanks

    • @ugurcodes
      @ugurcodes  2 месяца назад

      thanks! Do you have any other content would you like to see?

  • @xico6814
    @xico6814 2 месяца назад +1

    Hahaha thank you very much 😅
    And sorry for the inconveniences

    • @ugurcodes
      @ugurcodes  2 месяца назад

      Hahaha no I actually like getting people’s ideas and recording them. It was actually helpful to me. Thanks!🙏

    • @xico6814
      @xico6814 2 месяца назад

      I will change the permissions to make it another way then will PR and if you want you can make a video about it.

  • @yashrajjaiswal9941
    @yashrajjaiswal9941 2 месяца назад +2

    is it possible to do this in next js middleware ?? so that we don't have to write the same code for every page

    • @naylord5
      @naylord5 2 месяца назад +3

      Yes indeed, you can have a "routes" config file and setup the public and the privates routes, import it, then in the middleware check against user login, or in this case user specific role to conditionally redirect to another page.

    • @ugurcodes
      @ugurcodes  2 месяца назад +2

      This should be technically possible.
      but since we are using a postgres instance that runs locally, or in a server, and pg on "crypto" package which cannot be used in a edge runtime (-middleware runs in the edge).
      But if we use a serverless database for example, neon, it may be possible.
      neon.tech/blog/how-to-use-postgres-at-the-edge

    • @yashrajjaiswal9941
      @yashrajjaiswal9941 2 месяца назад

      @@ugurcodes can't use planetscale though 😆

  • @yashrajjaiswal9941
    @yashrajjaiswal9941 2 месяца назад

    if lucia manages session , then is it possible for us to create multi device login system like clerk 🤔

  • @mehmethanifierenler3612
    @mehmethanifierenler3612 2 месяца назад +1

    kardeşim türkçesi yok mu bunun

    • @ugurcodes
      @ugurcodes  2 месяца назад

      Yok maalesef :( hangi tutorial türkçe ki bu zamanda

    • @mehmethanifierenler3612
      @mehmethanifierenler3612 2 месяца назад

      @@ugurcodes haklısın, ücretli kompenentlerin yanın da ücretsiz olan abonelik ücreti istemeyen yazılımları da anlatırsan müteşekkir oluruz.