This adds the ability to handle null usernames when they don't comply with Clerk's username requirements and you don't want to let the user type their own.
Length 4-64
One Alpha Char
Feel free to make modifications as needed.
We use user.externalAccounts.find((externalAccount) => externalAccount.provider === "oauth_github")?.username || null so this could be modified if someone is using any OAuth account.
This is until we work on username requirements being set by the user versus Clerk. When Clerk updates that feature we can remove this change.
This adds the ability to handle null usernames when they don't comply with Clerk's username requirements and you don't want to let the user type their own.
Feel free to make modifications as needed.
We use
user.externalAccounts.find((externalAccount) => externalAccount.provider === "oauth_github")?.username || null
so this could be modified if someone is using any OAuth account.This is until we work on username requirements being set by the user versus Clerk. When Clerk updates that feature we can remove this change.