Clerk not saving username
I am stuck with Theo course as I am noticing he is requesting username from the user being logged in but my username for some reason is null. Any idea why that might be the case? I used both my email and github to login to the application but it never gets updated for some reason.
Thanks for the clarity 😄
3 Replies
what’s your username on github? in theos tutorial he doesn’t enforce usernames in the dashboard so if it doesn’t adhere to our current username standards it will be null, but you can get around that but tapping the username from external
For me, I enabled Github and Google. The Github method affords a username, the Google method doesn't.
You could change up the identifier to just use ID. I've changed it up so that when username === null, I'll fall back to ID. There's a https://clerk.com/docs/nextjs/user-object#get-user-user-id that will help you out here.
User Object | Clerk
Information about the User object returned by Clerk's API
Investigated this further.
I'd feedback to @James Perkins that Clerk's UI is confusing for this issue, especially the dialog that shows by removing the password check and confirming.
I guess this is an edge case of solely going the route of just OAuth without username and password.
For me, as well as the fallback mentioned above, I've followed James' instructions above:
- Add the username field in Clerk's dashboard.
- Fill it out in your user accounts Clerk profile.