Single Account Multiple Devices Access

Hey, Not sure if this is what I need, also I don't know how opensaas works. How do I go about where users of my solution register a single account, now this account can have 1 to Many subscriptions active, meaning the same account token can be installed on n amount of different devices (say 10 devices limit) after that number is reached a subscription won't be allowed. How would this work? #singleaccountmultideviceaccess
10 Replies
kapa.ai
kapa.ai4mo ago
Hi @lajidey. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Hmm, I don't know enough to give you a confident answer yet. The knowledge sources provided do not contain specific information on how to implement a feature where a single account can have multiple active subscriptions and can be installed on a limited number of devices. However, Wasp does support authentication and user account creation. When a user signs in for the first time, Wasp creates a new user account and links it to the chosen auth provider account for future logins source (https://wasp-lang.dev/docs/auth/social-auth/overview#default-behavior). For more complex features like the one you described, you might need to extend the functionality provided by Wasp with your own custom code. This would likely involve keeping track of the number of devices each account is installed on and checking this number before allowing a new subscription. For more information on how to use Wasp, you can check out the official documentation (https://wasp-lang.dev/docs). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @lajidey, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
lajidey
lajideyOP4mo ago
@kapa.ai How to extend the functionality provided by Wasp with my own custom code. That would likely involve keeping track of the number of devices each account is installed on and checking the number count before notifying account for Max limit
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- I'm sorry, but the provided knowledge sources do not contain specific information on how to extend the functionality of Wasp to track the number of devices each account is installed on and check this number before allowing a new subscription. However, Wasp does allow you to define extra fields during the signup process. This could potentially be used to store information about the devices an account is installed on source (https://wasp-lang.dev/docs/auth/overview#1-defining-extra-fields). For more complex features, you might need to write custom server-side code. Please note that as of now, Wasp does not provide a way to test your server-side code, but they will be adding support soon source (https://wasp-lang.dev/docs/project/testing#testing-your-server-side-code). For more detailed guidance, I recommend checking the official Wasp documentation (https://wasp-lang.dev/docs) or reaching out to the Wasp community for help. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @lajidey, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
Vinny (@Wasp)
Vinny (@Wasp)4mo ago
Hey @lajidey I've never done this before, but I'm sure it's possible. You'd have to do some googling about how to recognize a different device within your app. Then you'd set up a new field on the User entity and update how many devices they've signed in on. Once they reach the max amount, you block access when they log in from that newest device.
Vinny (@Wasp)
Vinny (@Wasp)4mo ago
Medium
Building a Custom Hook to Detect User Device in React.js 🚀
In today’s digital world, ensuring optimal user experience across different devices has become paramount. As a React.js developer, one way…
Vinny (@Wasp)
Vinny (@Wasp)4mo ago
But this approach definitely seems to have drawbacks There are many things you'd need to consider here. What if the user buys a new device, for example. You might need to give them a way to delete a device and add a new one.
martinsos
martinsos4mo ago
This is something like Netflix does, and other streaming services? Yeah, what @Vinny (@Wasp) said. Relevant term might be "fingerprinting". And as Vinny said, you will want to keep a list of them in the database for each user, and once there are too many, you could do something about it. How to keep sending that information from client/frontend to the server/backend though hm -> you could do it only in certain situation, e.g. on accessing certain parts of your app. Or maybe on login -> auth hooks should be helpful there. Or you could always add it as a header to every request and then add custom middleware for parsing that on the server although that might be a bit much. Shoulld certainly google how others do it.
lajidey
lajideyOP4mo ago
@Vinny (@Wasp) thank you for your input @martinsos yeah similar to that scenario
MEE6
MEE64mo ago
Wohooo @lajidey, you just became a Waspeteer level 1!
Vinny (@Wasp)
Vinny (@Wasp)4mo ago
You're welcome. Let us know if you have any other Qs
Want results from more Discord servers?
Add your server