Manage authentication flow

Manage authentication flow in JavaScript — with the four heights of help laid out: do it now, make it easier for the next person to accept, work out the right move when you are stuck, and learn the pattern so it stops coming back.

4prompt heights
Open it in the interactive atlas →

The four heights

The same task, four distances: today's deadline, the next reviewer, the stuck moment, the pattern.

Execute — do the immediate task

+
We have to get login working for the mobile web client by Wednesday. Implement the authentication…
We have to get login working for the mobile web client by Wednesday. Implement the authentication flow that accepts email and password, sends them to the server for a session token, stores the token in a secure, non-accessible cookie, refreshes the token before expiry, and redirects to the dashboard on success. Failures should show a clear error message without exposing server internals.

Improve — make it easier to accept

+
Before I hand auth to the security reviewer, make the flow easy to verify: add a visible token…
Before I hand auth to the security reviewer, make the flow easy to verify: add a visible token expiry countdown in dev mode, document which endpoints exchange credentials and which set cookies, surface where tokens are stored and why (cookie vs localStorage), and flag any places that still read the raw token directly in client code.

Decide — diagnose the stuck moment

+
Some users report they get logged out when they reload the app. The server issues short-lived…

Users are intermittently logged out on page reload.

Some users report they get logged out when they reload the app. The server issues short-lived session tokens and we store them in a secure cookie, but we also recently added an iframe that hits an auth-heavy endpoint. I suspect SameSite or cookie path issues or that the refresh-before-expiry logic doesn’t run for cold loads. I can’t reproduce reliably. What are the most likely causes and the quickest checks to confirm whether cookies, SameSite, or missing refresh calls are to blame?

Become — change the pattern

+
Across several releases we keep introducing session reliability problems: token expiry handling,…

Authentication bugs keep breaking user sessions across updates.

Across several releases we keep introducing session reliability problems: token expiry handling, inconsistent storage between SPA and legacy pages, and refresh race conditions. These cause support tickets and urgent patches. Which two practices or small technical boundaries should we adopt to reduce these issues — one change to the auth codebase and one process change for future work?

Next to this one

Other programming language work people do in JavaScript.

Every task here came from the work, not from a feature list — which is why the prompts name what you want done and never the button that does it. The tool changes; the work does not.
Copyright © LLOS.ai · 2026 — original pedagogy, voice, and design — all rights reserved.

The rest of the map

Same library, five ways in.