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
- Cant configure email templates
i configure it on the console, and when i send the OTP, it sends with appwrite's email (instead of custom smtp) and with the branding, but i have the Pro (educa...
- Need help with createExecution function
Hi, Need some help understanding createExecution. When requesting function execution via createExecution, the function handler arguments are incorrect and rese...
- Need Help with Google OAuth2 in Expo usi...
I'm learning React Native with Expo and trying to set up Google OAuth2 with Appwrite. I couldn't find any good docs or tutorials for this and my own attempt did...