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,
|
name: string,
|
||||||
companyName: string,
|
companyName: string,
|
||||||
) {
|
) {
|
||||||
// Generate slug from company name
|
// Generate slug from company name (underscores for valid PostgreSQL schema names)
|
||||||
const slug = companyName
|
const slug = companyName
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.replace(/[^a-z0-9]+/g, '-')
|
.replace(/[^a-z0-9]+/g, '_')
|
||||||
.replace(/(^-|-$)/g, '')
|
.replace(/(^_|_$)/g, '')
|
||||||
.slice(0, 40);
|
.slice(0, 40);
|
||||||
|
|
||||||
// Check slug uniqueness
|
// Check slug uniqueness
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue