lnbits / usermanager

Generate users and wallets
MIT License
3 stars 7 forks source link

UserManagement extension: Feature proposal: Unique Users #10

Open airlacodes opened 1 year ago

airlacodes commented 1 year ago

Would it be possible to fail this call if the username / email already exists? Happy to open a PR to do it but wanted to check there's a reason for not doing it currently... its currently possible for the same username and email to be used for any number of users.

https://github.com/lnbits/lnbits/blob/4ad3c841528de3efafefe48f667e6800eb7074e3/lnbits/extensions/usermanager/crud.py#L18

dni commented 1 year ago

i think the reason is that currently it does not really matter if they are duplicate username / email, because as far as i know we do not use username / email at all and users are only identified by the id.

callebtc commented 1 year ago

Correct we haven't used the username and email for anything yet. Any thought @arcbtc?

airlacodes commented 1 year ago

it adds a barrier to entry for apps that are trying to give their existing users wallets. The barrier is having to create a table of [UserId: LNBitsUserIDs] and have a service to write / remove from that accordingly within their backend. Where as if LNBits just rejected a duplicate user, it takes the burden off the integration cc @arcbtc

talvasconcelos commented 1 year ago

Adressing it here: https://github.com/lnbits/usermanager/pull/5

Consider closing the issue, or opening it on the extension's repo!