Next.js Auth with Roles & Permissions (RBAC / Authorization) - Protect your app the professional way

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

Hi, I'm Wesley. I'm a brand ambassador for Kinde (paid sponsorship).

👉 Discord: all my courses have a private Discord

⏱️ Timestamps:
00:00 Authorization intro
04:35 Example app overview
06:56 Add authentication
13:09 Add authorization (roles & permissions)
19:27 Change UI depending on user permissions
21:31 Get role
22:39 Revoking access

#webdevelopment #reactjs #nextjs
Рекомендации по теме
Комментарии
Автор

Unfortunately, using sas for auth and authorization is not something that startups and even more so medium-sized companies are willing to sacrifice. if, for example, emailing or file uploading can be left to sas, but users, their administration and so on is unlikely. it would be great if another player or library appeared on the market that solved the authentication problem well. we only have two big things right now, right? next-auth and lucia. the former is still very raw and confusing, and the latter has less support and poor documentation

bibblebabl
Автор

I like this but I’m a bit concerned of what happens when the Kinde servers are offline for some reason. Then my whole app doesn’t work anymore, right? I don’t like it when my auth logics depends on a third party service. I mean it’s very essential.

BliitzPint
Автор

Great video! Thanks for the comprehensive explanation on managing roles and permissions with Kinde.

I have a question: could you make a video showing how an admin can create accounts for other users, like clients, support agents, or sales representatives? Specifically, I'm interested in the admin selecting a role from a list (e.g., client, support agent, representative) when creating these accounts. Is this possible with Kinde, and if so, how can it be implemented?

I have a use case where only the admin can create all the accounts, and other users can just sign in.

Thanks in advance

eladr_
Автор

i need to set user role when user is signup. as an example think about job vacancy site. when user is registering user can select whether he is an employer or an employee. like that. can this be achieved by kinde auth.

brutalcodm
Автор

Please build a project where you'll need to host an extra Express server along with Next.js

letsgetstarted.
Автор

can we have class based server actions? to support inheritance etc?

huzaifaqayyum
Автор

0:35 is there a way with Kinde to integrate the login form inside our app as a component, instead of redirecting the user outside our app (in order to keep the layout/header/flooter etc.) ?

ZitoxLD
Автор

Can't we combine the two calls? `const { isAuthenticated, getPermission } = getKindeServerSession();`

Seems redundant to do them separately

farzadmf
Автор

I've learned a lot, thanks <3

Devlicious-mr
Автор

Would be awesome to have some SolidJS && SolidStart content.

PhilanJames