K
Kinde•3mo ago
jw

User handles / usernames

I would like every user of my app to have a (unique) username, similar to handles on e.g. Twitter, Instragram, reddit... It's a bit unclear how to do this though. I've enabled username sign-in, so users can sign in and sign up using a username. However, it's still possible for a user to sign up with just an e-mail address. How do I force every user to pick a (unique) username? Or would you recommend I only keep e-mails in Kinde and keep usernames separate in my own DB?
6 Replies
IkiTg07
IkiTg07•3mo ago
Hey, so it's not so clear for me because i'm not using username authentication. But in the docs each username is bound to an email in order to make the initial account verification. In the process of signin-up the user fills its info and then after getting the code he picks his username So it should be unique in theory Do you have an env in which I could test signin up ?
jw
jwOP•2mo ago
Sorry for the late reply. I don't have a publicly available test environment no. But my question with that procedure is as follows: you propose the user uses an e-mail address to sign up. Then I suppose he is redirected to a page that I create (not hosted by Kinde) in which he picks a username. How do I sync this username to Kinde? How do I ensure there is no race condition? Do I keep the username in my own database (as the single source of truth) and sync to Kinde afterwards?
jw
jwOP•2mo ago
Sorry I think I misunderstood your reply. According to this sign-up flow in the doc users can pick a username as part of the sign-up flow. I still run into problems though... The "new user" form allows the user to enter either a username or e-mail. If I try to enter "[email protected]" as test value, this is somehow considered a username (even though according to the documentation + and @ are not allowed in a username 🤨) and I get prompted to enter an e-mail address.
Kinde docs
Username authentication
Our developer tools provide everything you need to get started with Kinde.
jw
jwOP•2mo ago
Update: I decided to implement custom login and signup pages (although not strictly necessary), and handle usernames separately as an "onboarding" procedure on my end. (So if I detect a user exists in Kinde but not in my database, this is triggered.)
jw
jwOP•2mo ago
This is not fully how I'd like it to be and feels too complex. I hope one of the features on the roadmap (https://updates.kinde.com/board/custom-forms) will simplify this in the future.
Custom forms
Custom forms
Oli - Kinde
Oli - Kinde•4w ago
Hey @jw, Sorry you experienced this issue with username authentication with Kinde. If you enable only Username connection (under 'Password connections') as the only authentication method for a given Kinde application the experience is as follows 👇 Sign-up 1. Enter unique username 2. Enter email + OTP (to verify email) 3. Set password The email verification is required for when you reset your password as we need a way to verify you. Sign-in 1. Enter username 2. Enter password You can read more details about username authentication here: https://docs.kinde.com/authenticate/authentication-methods/username-authentication/ If you enable only Username connection, your users should not be able to sign-in with an email, only username.
Kinde docs
Username authentication
Our developer tools provide everything you need to get started with Kinde.

Did you find this page helpful?