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...
Wow ! I was about to ask about it :D Thanks Ugur !
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!
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
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!
author of Lucia Auth, don't recommend using middleware. you can check out this article: pilcrowonpaper.com/blog/middleware-auth/
You've made me hit the subscribe button
Omg! thanks :D
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!
Hi! thank you so much, you made my day :)
I love these videos Uğur thank you so much, lucia definitely needs video tutorials
Thank you so much 😊 these comments make me really happy!
Can Lucia be used in a MERN stack, if it can, please do a tutorial
Nice!! Couldn't this be implemented in a middleware file?
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.
Great video!
Thanks!
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.
I'd be glad to record video around freelancing but I'm not sure if people would watch it
They would watch 👍
I also thought about asking for a video about it, I am definitely interested as well @ugurcodes 🙏
excelent and simple!! thanks
thanks! Do you have any other content would you like to see?
Hahaha thank you very much 😅
And sorry for the inconveniences
Hahaha no I actually like getting people’s ideas and recording them. It was actually helpful to me. Thanks!🙏
I will change the permissions to make it another way then will PR and if you want you can make a video about it.
is it possible to do this in next js middleware ?? so that we don't have to write the same code for every page
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.
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
@@ugurcodes can't use planetscale though 😆
if lucia manages session , then is it possible for us to create multi device login system like clerk 🤔
kardeşim türkçesi yok mu bunun
Yok maalesef :( hangi tutorial türkçe ki bu zamanda
@@ugurcodes haklısın, ücretli kompenentlerin yanın da ücretsiz olan abonelik ücreti istemeyen yazılımları da anlatırsan müteşekkir oluruz.