Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.
Identity session
Paths are relative to the webv2 src/ directory.
App and Platform transport hand credential to Identity per ARCHITECTURE.md.
- Identity holds tab's bearer token in memory, bound to account lifetime it authenticates; once that lifetime ends no request can carry it. Each HTTP request captures token and lifetime together, and reports a returned
X-Refreshed-Token(sliding renewal, or replacement after caller's own password change) and any 401 against that capture. Identity accepts a replacement only while capture's lifetime and token are still current, and a 401 only for current token, so a late response can neither renew nor expire a newer credential. - Renewals replace token in place: no new lifetime, remount or cleanup. Media cookie re-issued at most every five minutes, since renewals do not extend it.
- Own password change runs as a credential rotation scoped to lifetime that queued it. Changes run one at a time; one still queued when its lifetime ends is rejected unsent, not dispatched with next account's credential. Until a rotation settles, other replacements are ignored, and a 401 for current token or another tab's renewal waits for its outcome: a delivered replacement supersedes them, a failed change lets them apply. Another tab's sign-out applies at once and discards replacement, because storage cannot tell a deliberate sign-out from any other and a deliberate one must end every tab.
- Rotation is announced in
localStoragefor its principal while in flight, each under its own key so concurrent changes from several tabs never overwrite one another. Withdrawn after replacement is stored, and when announcing tab leaves or ends its lifetime. Announcing also clears markers older than the wait and the single marker earlier builds wrote, whose announcements are not seen during a rolling upgrade. The announcement lets a tab whose token the change revokes hold the sign-out that 401 would cause (request itself still fails to its caller) until replacement is stored and adopted. Includes a tab whose own concurrent change the other change revoked. Session expires if every announcement of that principal is withdrawn without a replacement, or 30 seconds after latest one still announced if its tab never settles. A tab restoring or following a token rejected under an announced rotation waits the same way, then continues from whatever storage holds. - Sign-in attempt leaves stored token alone until it succeeds.
- Socket authenticates every connect attempt with current token; reconnects after server closes a session whose token was replaced.
localStoragepersists token across reloads and carries other tabs' changes. Read when a session resolves and on reconciliation (storageevents, back/forward-cache restores, returning to view), never per request. Another tab's renewal for the same principal (judged from token'suser_idclaim) is adopted in place; a removal signs this tab out; any other change ends current lifetime first, then resolves and activates new principal like a restored session, latest stored value winning. Rejected token signs tab out as expired; unreachable backend leaves it signed out with token stored and unobserved, so next reconciliation retries. Writes this tab made itself are not read back as changes; blocked storage leaves sign-in working for tab's lifetime.- An expiry records the expired account in
expiredUserIduntil the next sign-in or a deliberate sign-out: the signed-in user for a 401 on the current token, the stored token's claim when a reload finds that token rejected. A followed token the backend rejects records none, since it belonged to another tab's account while this page still shows the old one's. The login screen returns to the router'sreturnToonly when that same account signs back in, here or followed from another tab; another account starts at Home.returnTois accepted only as an in-app path (readLoginReturnPath), never another origin or the auth screens. - While this tab follows another tab's sign-in to a different account, the session reports
switchingAccount; the old lifetime has already ended, so nothing of either account renders until the new one resolves. - Expiry warning: the backend's tokens carry an
expclaim, renewed by every successful change request (sliding window: one day, or a week with "Keep me signed in").watchSessionExpiryarms a timer for the held token and warns five minutes before itsexp; a renewal, a new lifetime or a sign-out aborts that warning and re-arms for the next token. The claim is read unverified and only to warn: the backend still decides. A token withoutexpnever warns. The warning offers no "Stay signed in": the backend renews only on a successful change request outside the auth routes (sign-in, sign-out and the media cookie never renew), and there is no renewal endpoint, so the honest way to stay signed in is the change the warning asks for.
User management entry
Launchpad imports user management through features/identity/launchpad, a deferred public entry. Home and ordinary identity/session consumers do not import the management forms. The route capability guard owns access; the deferred view owns its loading and retry presentation. An import failure uses a document reload on Retry to re-read the deployed entry and module graph; a view render failure retries in place. This entry does not rely on every browser caching failed fetches.