hello, it seems like we can have multiples account with the same name (created in the auth dashboard). Is there an option or way to make them unique ? like throw a error when calling account.updateName() with a name already existing in the users.
thanks !
I believe you would have to implement this check yourself, maybe in a function, you have logic that pulls users where name == name, and if that returns atleast 1 item fail the process?
You'll either have to maintain a user metadata collection to do this logic client side, if you want to do it server side you'll have to use the server sdk to access the users endpoints.
Thanks for the answer. That's pretty annoying, i'm using the Account client api, and so anyone can manually do a updateName and circonvent any added client side check for username duplications
i thought unique username would be the default behaviour
the user id is the unique value
but it can't be changed after creation i think ?
right
the only secure way of doing this i see, where the user can't temper with it is to do a function with a event on update name, and if it already exists reset it to the previous one or a default/random.
i'll submit a idea to the appwrite devs to just add a option field for a unique index on names
it seems like a useful feature, for a lot of social sites (comments, posts, etc)
Sure, but don't most if not all social medias allow for vanity names :P Wouldn't the name attribute of the user be the vanity name, and the id be their @?
Like discord, my username is not Kenny, that's my vanity name
oh, yeah forgot about preferences
but it doesn't solve the uniqueness constraint ?
it still need a server function to check if the new name in the attributes is unique
Sure, I can see where you're coming from. You can create a feature request if you want, but in the interum you'd had to implement this functionality yourself.
i'll just display the users as name:id for now
[SOLVED: not possible] duplicate user names
Recommended threads
- My account got banned without obvious re...
Hello, I’m a normal user of Appwrite. Today I found my account was banned suddenly, and I can’t log in normally. I have only been doing normal development and...
- cant resume project
Invalid console fingerprint event i try man time
- general_route_not_found - Auth Guide
If you’ve just added a subdomain to your project, verified your DNS records, and confirmed your SSL certificate is working, but you're still hitting a `general_...