fix: username sanitization, canvas creation modal fixes, and auth headers for tasks

This commit is contained in:
2026-05-03 21:12:55 +05:00
parent 4a912d972e
commit f0b5883084
5 changed files with 47 additions and 39 deletions
+2 -1
View File
@@ -34,7 +34,8 @@ export default defineEventHandler(async (event) => {
const fbUser: FirebaseUser = verifyRes.users[0]
const email = fbUser.email
const username = email.split('@')[0]
// Очищаем username: заменяем пробелы на дефисы и убираем спецсимволы
const username = email.split('@')[0].toLowerCase().replace(/\s+/g, '-').replace(/[^a-z0-9-_]/g, '')
const userId = fbUser.localId
const user = await prisma.user.upsert({