Problem with licenses creating for shop
hello anyone that is able to help me i am trying to make a shop with license so as example a month and lifetime but when i claim(buy) it its bought for everyone but i want that i am able to sell unlimited and that when someones redeems the license its get connected to his account (discord/email) can someone help i just started>

27 Replies
for the code tag me
just started so idk exactly how to do everything
you need to tie the purchase to a specific account
how can i do it
can u help me or something
i don't want to get too into helping because i have my own demands on time but i can give ideas on how to help
sure tell me
basically in whatever your database setup is, you need to link a user account and the license purchased by that account. then when you're on your website, you check the currently logged in user against that table in the database
could u take a look at my schema.prisma what the best options are to use for like anticheat licenses and stuff
i want to make it so u can just buy it and the license gets sent to your email and then when it gets redeemed it gets connected to that account
you'll need a License model in your schema then
could u maybe fix that cause i dont understand it xD
tried mutiple things
how are you currently using your Item model?
what u mean?
this?

your Item model is supposed to show your purchased license, right?
im a beginner so i try my best sorry
like this?
model License {
id String @id @default(cuid())
licenseKey String @unique
itemId String
item Item @relation(fields: [itemId], references: [id])
userId String?
user User? @relation(fields: [userId], references: [id])
claimed Boolean @default(false)
claimedAt DateTime?
activated Boolean @default(false)
activatedAt DateTime?
}
----------------------- AND ---------------------
model Item {
id String @id @default(cuid())
name String
type String // e.g. "1month" | "lifetime"
licenses License[]
} like this? @mukomo
} like this? @mukomo
No, that's incorrect
could u help out
It'll be a bit. I'm out of the house
ah shit
can u try?
what about now?
@mukomo able to help now
alright, let's try this again
You want to be able to show a user on your website if they've purchased a license
In your database, do you have that information?
i did try some more and it is kinda working rn but testing some more
now people can buy infinite licenses and when redeemed it gets activated and put on that users userid
got to here

@mukomo is it possible to get the basic layout header removed in a different page

yes
i don't know exactly how but i know it's possible
could u maybe help find it
worked
got it fixed
how can i fix that the stuff that is here on the first screen goes to the output from a different file
these are both files
@mukomo