fix: use underscores in tenant slug for valid PostgreSQL schema names
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
34caa25c71
commit
7ff012cd91
|
|
@ -141,11 +141,11 @@ export class AuthService {
|
|||
name: string,
|
||||
companyName: string,
|
||||
) {
|
||||
// Generate slug from company name
|
||||
// Generate slug from company name (underscores for valid PostgreSQL schema names)
|
||||
const slug = companyName
|
||||
.toLowerCase()
|
||||
.replace(/[^a-z0-9]+/g, '-')
|
||||
.replace(/(^-|-$)/g, '')
|
||||
.replace(/[^a-z0-9]+/g, '_')
|
||||
.replace(/(^_|_$)/g, '')
|
||||
.slice(0, 40);
|
||||
|
||||
// Check slug uniqueness
|
||||
|
|
|
|||
Loading…
Reference in New Issue