/** * The Stop link an SMS carries (TRUSTED RECOVERY BUILD 1; src/recovery_circle.ts): `/v1/recovery/stop//` * on the open host, no bearer, no script. GET shows one button; POST stops the request the token names (and only it) * and says so. A token that names nothing waiting is answered the same way as one that stopped something already, so * the page says nothing about an account. Words are drafts for the owner's sheet. */ export const STOP_PATH = /^\/v1\/recovery\/stop\/([A-Za-z0-9_-]{1,64})\/([A-Za-z0-9_-]{20,64})$/; const PAGE = (body: string) => new Response( `Cotton${body}`, { headers: { "content-type": "text/html; charset=utf-8", "cache-control": "no-store", "referrer-policy": "no-referrer", "content-security-policy": "default-src 'none'; style-src 'unsafe-inline'; form-action 'self'" } }, ); export async function stopPage(request: Request, stop: () => Promise): Promise { if (request.method === "POST") { await stop(); return PAGE("

Stopped

If someone was getting into a Cotton account on a new phone, they can't now. Nothing was opened.

"); } return PAGE('

Stop getting in on a new phone?

Someone asked to open your Cotton on a new phone. If that wasn\'t you, stop it.

'); }