Build secureFlows hosted login URL
secureflows_build_login_urlBuilds a correct hosted-login redirect URL. Needs no secureFlows token — safe to call at app-scaffolding time, before any user session exists, which is the phase most secureFlows integration mistakes happen in.
Always targets /app/sessions/login (session apps). Never builds the legacy /app/login console URL, which returns a firebaseToken your SecureFlowsCallback handler cannot consume and causes an infinite redirect loop.
Use this instead of hand-building the URL with URLSearchParams — hand-built login URLs are the #1 source of the login-loop and stale-renewal bugs documented in SKILL.md.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| appId | Yes | App id from the human prompt ("appId = ...") | |
| intent | No | fresh_login: normal sign-in, or app-load restore with no prior token (default — almost always correct, including after an explicit sign-out). renew_expired_token: ONLY when resuming the SAME still-intended user after a soft token expiry (401/410) while staying logged in — never after Sign out. | fresh_login |
| origin | No | secureFlows origin — always https://www.secure-flows.com in production | https://www.secure-flows.com |
| redirectUri | Yes | The app's unguarded /callback URL, built from the published/allowlisted app origin — never from an iframe or editor chrome origin. | |
| expiredToken | No | The old sessionToken to renew. Only read when intent=renew_expired_token. Setting this after an explicit sign-out is the "send a dead JWT into hosted login" anti-pattern — it breaks renewal when the underlying identity changed. | |
| workspaceName | Yes | Workspace name from the human prompt ("workspace = ...") |