Next.js Discord

Discord Forum

Invite Only SignUp

Answered
alfie posted this in #help-forum
Open in Discord
need help making an invite only signup - no idea how to go about either so any help would be appreciated
Answered by Arinji
once a user uses the invite code, check if its valid aka not expired, not taken, present in the db. If its valid, make the user sign up then set the user id in the invite table as the user id who signed up
View full answer

8 Replies

bump
@alfie halo
so basically this is how i would structure it, you have a table for invites
have it store the invite id, expiry time and the user id (set it to null as default)
once a user uses the invite code, check if its valid aka not expired, not taken, present in the db. If its valid, make the user sign up then set the user id in the invite table as the user id who signed up
Answer
voila there you go, invite codes done
@Arinji voila there you go, invite codes done
awesome! which db would you recommend to store my users & invites? and am i able to have multiple dbs with prisma? as i currently have a sqlite db w prisma for the CRUD part of my site