Merge pull request #32959 from overleaf/ab-fix-32861-spam-safe-project-name

[saas-e2e] Fix project name generation still producing + and / characters

GitOrigin-RevId: 2367c8d45ee9ec4441e9ee2a1d74c2fd281f9e90
This commit is contained in:
Alexandre Bourdin
2026-04-21 11:47:11 +02:00
committed by Copybot
parent 926d6bccd7
commit 77b9d2fd1b

View File

@@ -245,7 +245,8 @@ export function getSpamSafeProjectName() {
// Move from hex/16 to base64/64 possible characters per char in string
const name = Buffer.from(uuid().replaceAll('-', ''), 'hex')
.toString('base64')
.replace('/', '_')
.replaceAll('/', 'x')
.replaceAll('+', 'y')
.slice(0, 10)
const nDigits = (name.match(/\d/g) || []).length
if (nDigits < 6) return name