Discord multi-role authentication system

I want to create a multi role authentication system using Discord as an auth provider in my Next.JS app. Is it possible?
10 Replies
iDarkLightning
iDarkLightning12mo ago
Like synced to discord's roles?
Gold240sx
Gold240sxOP12mo ago
Either that or just have paid users, admins, reg users, moderators etc. I've tied things like this to firebase and supabase, but i've only done single role auth with Discord. if tied to Discord's roles, i suppose I would need to tie in specific discord roles to particular users somehow.
iDarkLightning
iDarkLightning12mo ago
If its tied to discord's roles, then they would have to be linked with like servers and people would have to be in servers, etc. if you just want regular RBAC then your auth provider being discord has like almost no impact
Gold240sx
Gold240sxOP12mo ago
Okay, so if i set up the auth in Discord then and. i saved all the information within something like supabase, i assume I would need a way to save a link between the two? if so would that come from an api response? Sorry for the line of questions. Most searching returned mult-factor authentication.
iDarkLightning
iDarkLightning12mo ago
Link between the two for what
Gold240sx
Gold240sxOP12mo ago
When I create a new user in Supabase or Firebase, the user is assigned a userId. When i simultaneously creaet a document for their information, I save the id from auth to the doc so that they're linked and I know that this user's info belongs to this perrson who is signed in. info including role="admin" for instance.
Rhys
Rhys12mo ago
GitHub
AnswerOverflow/packages/api/src/utils/permissions.ts at main · Answ...
Indexing Discord Help Channel Questions into Google - AnswerOverflow/AnswerOverflow
Rhys
Rhys12mo ago
That’s got all the implementation details you’re looking for
Gold240sx
Gold240sxOP12mo ago
That looks perfect! Thank you both. I’ll take a good look.
Zan
Zan12mo ago
Can also get discord role info (within the context of a server) pretty easy with discordjs https://github.com/AnIdiotsGuide/discordjs-bot-guide/blob/master/understanding/roles.md I had a project where I wanted the web app to show particular options if the user was an mod/admin of the discord server that was associated
GitHub
discordjs-bot-guide/understanding/roles.md at master · AnIdiotsGuid...
The basic new coder friendly "idiot's guide", Created by Hindsight#2020 and maintained by the community. - AnIdiotsGuide/discordjs-bot-guide
Want results from more Discord servers?
Add your server