Add LOGIN_DOMAIN environment variable that appends a domain to emails
missing one during external login (OAuth/SAML/SCIM). When set, emails
without '@' will have '@{LOGIN_DOMAIN}' appended.
Example: LOGIN_DOMAIN=example.com transforms "john" to "john@example.com"
Also includes a migration to lowercase existing emails in critical tables:
- password (primary user identity)
- usr (workspace users)
- email_to_igroup (instance group memberships)
- token (active sessions)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
15 lines
683 B
SQL
15 lines
683 B
SQL
-- Normalize emails to lowercase for consistency with external login normalization
|
|
-- This migration lowercases email columns in critical authentication tables
|
|
|
|
-- Lowercase emails in password table (primary user identity)
|
|
UPDATE password SET email = LOWER(email) WHERE email != LOWER(email);
|
|
|
|
-- Lowercase emails in usr table (workspace users)
|
|
UPDATE usr SET email = LOWER(email) WHERE email != LOWER(email);
|
|
|
|
-- Lowercase emails in email_to_igroup table (instance group memberships)
|
|
UPDATE email_to_igroup SET email = LOWER(email) WHERE email != LOWER(email);
|
|
|
|
-- Lowercase emails in token table (active sessions)
|
|
UPDATE token SET email = LOWER(email) WHERE email != LOWER(email);
|