I realize there are many forum posts on this topic, but none have helped me solve my problem. I’ve found bits and pieces that are helpful, but I’ve gone delirious trying to put them all together.
I am trying to build a user publishing app where authors have unique user names that display in their bylines and direct you their user profiles. (Wattpad is a close reference example).
I would like the unique username to be confirmed at signup. I’ve read you can do this via a “Do a search for users” or use slugs. I just want to confirm my understanding at this point so far:
- If I do a search for users, it makes sure the username is available, as long as I’ve set capitalization parameters, correct?
- If I use slugs, I don’t need a username input on the sign up form, correct? I could have the user change their username in their settings, which could then reset the slug? And this addresses any lowercase, caps, issues?
Questions:
- Does the slug automatically become “signupname” and then “signupname-1, signupname-2”? If so, I’m leaning toward keeping the username input to allow more creative names.
- How do I set up the capitalization parameters? (I copied the “trimmed:lowercase” from someone else but not sure what it actually does). Ultimately I want the user name to be in this format: Abcde-Bcde-1 and prevent duplicates from being added.
- What would I set up as the condition to make the signup button not clickable if the username is not valid? My current test allowed the form to go through but did not add the user to the database.
Here are my current settings based on the info I’ve found so far.