fix: name in sso signup (#4587)

This commit is contained in:
Dhruwang Jariwala
2025-01-13 10:41:41 +05:30
committed by GitHub
parent 01a4d91167
commit dd5fced6c4

View File

@@ -65,7 +65,12 @@ export const handleSSOCallback = async ({ user, account }: { user: TUser; accoun
}
const userProfile = await createUser({
name: user.name || user.email.split("@")[0],
name:
user.name ||
user.email
.split("@")[0]
.replace(/[^'\p{L}\p{M}\s\d-]+/gu, " ")
.trim(),
email: user.email,
emailVerified: new Date(Date.now()),
identityProvider: provider,