feat: unify admin identity — SAAS_ADMIN_USER is the email in SaaS mode
In SaaS mode, SAAS_ADMIN_USER must be an email address. It's used as both the Logto username and primaryEmail. No separate SAAS_ADMIN_EMAIL. Installer enforces email format in SaaS mode (moved deployment mode question before admin credentials), accepts any username in standalone. Sign-in form label changed to "Login". Removes SAAS_ADMIN_EMAIL from bootstrap, compose template, installers, and all documentation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -27,9 +27,8 @@ API_RESOURCE_NAME="Cameleer SaaS API"
|
||||
# Users (configurable via env vars)
|
||||
SAAS_ADMIN_USER="${SAAS_ADMIN_USER:-admin}"
|
||||
SAAS_ADMIN_PASS="${SAAS_ADMIN_PASS:-admin}"
|
||||
# Admin email: use provided value, or derive from username@host.
|
||||
# SaaS enforces email as the user identity — admin must have one.
|
||||
SAAS_ADMIN_EMAIL="${SAAS_ADMIN_EMAIL:-${SAAS_ADMIN_USER}@${PUBLIC_HOST:-localhost}}"
|
||||
# In SaaS mode, SAAS_ADMIN_USER is the admin's email address.
|
||||
# Use it as both username and primaryEmail in Logto.
|
||||
|
||||
# No server config — servers are provisioned dynamically by the admin console
|
||||
|
||||
@@ -397,12 +396,12 @@ ADMIN_USER_ID=$(api_get "/api/users?search=$SAAS_ADMIN_USER" | jq -r ".[] | sele
|
||||
if [ -n "$ADMIN_USER_ID" ]; then
|
||||
log "Platform owner exists: $ADMIN_USER_ID"
|
||||
else
|
||||
log "Creating platform owner '$SAAS_ADMIN_USER' (email: $SAAS_ADMIN_EMAIL)..."
|
||||
log "Creating platform owner '$SAAS_ADMIN_USER'..."
|
||||
ADMIN_RESPONSE=$(api_post "/api/users" "{
|
||||
\"username\": \"$SAAS_ADMIN_USER\",
|
||||
\"password\": \"$SAAS_ADMIN_PASS\",
|
||||
\"name\": \"Platform Owner\",
|
||||
\"primaryEmail\": \"$SAAS_ADMIN_EMAIL\"
|
||||
\"primaryEmail\": \"$SAAS_ADMIN_USER\"
|
||||
}")
|
||||
ADMIN_USER_ID=$(echo "$ADMIN_RESPONSE" | jq -r '.id')
|
||||
log "Created platform owner: $ADMIN_USER_ID"
|
||||
|
||||
Reference in New Issue
Block a user