How to prevent password sharing (or only permit 1 session)

Options

I aim to prevent a scenario where a team of individuals shares a single subscription instead of purchasing individual profiles for each member.

  • User A logs in with profile A
  • User B logs in with profile A

Is there a way to log user A out when B starts a new session with that profile for example? I want to ensure that they are unable to use the subscription simultaneously, at the very least.

I'm kinda new to this, so if anyone could help me out, it'd appreciate it. Thanks!

Best Answer

  • Lefteris - blupry.com
    Lefteris - blupry.com Member ✭✭
    Answer ✓
    Options

    Hello @Targox,

    Xano doesn't have a built-in function (at least to my recent knowledge) for something like this.

    A simple, but definitely not safe way to do that would just be by using a boolean field on the user table, true if logged, false if logged out, and compare that to the boolean of the other user on the same subscription.

    Hope that helps you to move forward, until you find a better solution.

Answers

  • Targox
    Targox Member
    Options

    @Lefteris - Buynocodeapps I see. Thanks for the info, I’ll try your suggestion for now. Why would you say this isn’t a safe way exactly?

  • Lefteris - blupry.com
    Options

    @Targox, mostly because unless you have a great designed backend + API structure (which is not always achievable), a simple field shouldn't have that much "value".

    Good thing is that with Xano it's much harder for things to go wrong, but better be safe than sorry.

    Until you go big big, this "solution" should work fine.