Nexus Login & Tower URL Management
Overview
Tower's own email/password login is replaced by an OAuth 2.0 code flow against Nexus. The Tower's public URL is centralized via the activation token, and operators get a dedicated recovery screen when the registered URL has drifted.
How it works
- The login page redirects to Nexus, passing
company_id(from the activation token) so Nexus can display the company logo. - Nexus authenticates the user and the gateway redirects back to
/auth/callback, where thenexus-authmodule exchanges the code. InitializationServicereadstowerUrlfrom the activation token at startup and injects it intoConfigurationService.getTowerUrl()— the single source of truth for the Tower's public URL (deprecatingself.urlin YAML).- If the gateway detects a URL mismatch, it redirects to
/activate?reason=url_mismatch, where the operator can navigate to the registered URL or re-activate (POST /reactivate-url) with the current one. /login/passwordremains as a discrete legacy fallback.
Key files
src/core/auth/nexus/nexus-auth.controller.ts— OAuth callback +GET /auth/configsrc/core/bcyip-sync/bcyip-sync.service.ts— URL heartbeat with BCYIP (exmagic-auth)src/core/configuration/configuration.service.ts—setTowerUrl()/getTowerUrl()src/core/initialization/initialization.service.ts— readstowerUrlfrom activation tokensrc/protocol/bcyip/api.ts—getNexusWebUrl()derives URL fromBCYIP_TARGET_ENVui/src/pages/login/login.tsx,NexusCallback.tsx,activate.tsx,LoginPassword.tsx
Technical decisions
- Tower URL lives in the activation token, not in editable settings —
PUT /config/settingswas removed and the Settings URL field is read-only. - Nexus web URL is derived from
BCYIP_TARGET_ENV(PROD/PREPROD/DEV), so noNEXUS_WEB_URLenv var is needed on deployed envs (it remains an override). BrandingLogouses a localStorage cache + opacity fade to prevent logo flash on load.
Next steps
- Remove the legacy
/login/passwordroute once all towers are migrated