// The approved copy for email sign-in, by review id. The strings are the // reviewed text byte for byte; TestSigninCopyMatchesApproved pins this map to // docs/superpowers/specs/2026-10-21-console-email-signin-copy-approved.json. package console import "strings" // signinCopy holds every approved string by its review id. var signinCopy = map[string]string{ "home.email_label": "Your email address", "home.email_placeholder": "you@example.com", "home.email_button": "Continue", "home.small": "New here or coming back, it's the same form. Keymail addresses sign in with Keymail. Any other address gets a link and a code by email, and your first sign-in sets up your account. No passwords.", "home.invite_prompt": "Sign in as {address} to accept your invitation.", "home.cli_prompt": "Sign in to approve your terminal.", "home.bad_address": "That doesn't look like an email address.", "home.no_mail": "This console can't send email yet, so it can only sign in Keymail addresses for now.", "check.title": "Check your email", "check.sent": "A sign-in link and code are on their way to {address}. Both work once, for 15 minutes.", "check.code_label": "Or type the code from the email", "check.code_button": "Sign in", "check.code_wrong": "That code doesn't match. Check the email and try again.", "check.code_used_up": "That code has expired or had too many wrong tries. Ask for a new link below.", "check.code_throttled": "Too many wrong codes for this address. Use the link in the email, or try again later.", "check.nothing": "Nothing arriving? Check your spam folder, or ask for a new link. You can ask once a minute.", "check.again_button": "Send a new link", "link.title": "Sign in as {address}?", "link.button": "Sign in", "link.expired": "That sign-in link has expired or was already used. Ask for a new one from the front page.", "link.wrong_site": "That sign-in didn't come from this page, so we stopped it. Open the link from your email again.", "stepup.title": "Confirm it's you", "stepup.sent": "To finish this, we've sent a link and a code to {address}. They work for 10 minutes, and only in this browser. Nothing has changed yet.", "stepup.code_label": "Type the code from the email", "stepup.code_button": "Confirm", "stepup.link_title": "Confirm it's you", "stepup.link_button": "Confirm and continue", "stepup.wrong_browser": "Open this link in the browser where you started, or type the code there. Nothing has changed.", "stepup.expired": "That confirmation has expired or was already used. Nothing has changed. Try the action again.", "email.signin.subject": "Your sign-in link for {console}", "email.signin.body": "Someone, hopefully you, asked to sign in to {console} as {address}.\n\nOpen this link to sign in:\n\n{link}\n\nOr type this code on the page that's waiting: {code}\n\nThe link and the code work once, for 15 minutes. If this wasn't you, ignore this email. Nothing happens without the link or the code.", "email.stepup.subject": "Confirm it's you on {console}", "email.stepup.body": "Someone signed in to {console} as {address} started an action that needs you to confirm it's you.\n\nOpen this link in the same browser to confirm:\n\n{link}\n\nOr type this code there: {code}\n\nThey work once, for 10 minutes. If this wasn't you, don't confirm. Sign in again and check your account's members and command line logins.", "email.invite.body": "{inviter} invited you to the account \"{account}\" on {console}.\n\nOpen this link to accept. You'll sign in as {to} first if you aren't already:\n\n{link}\n\nIt works once and expires in 7 days. If you weren't expecting this, ignore it. Nothing happens without the link.", "team.confirm_note": "Removing a member, handing over ownership and deleting the account each ask you to confirm it's you. A signed-in browser on its own isn't enough.", "team.invite_placeholder": "them@example.com", "team.invite_note": "We send the invitation by email, or to Keymail for Keymail addresses. It works once and expires in 7 days.", "team.bad_address": "That doesn't look like an email address.", } // copyText returns the approved string for id with each {key} placeholder // replaced by its value (kv is key, value, key, value, ...). An unknown id is // a programming error and panics, so a typo cannot ship blank copy. func copyText(id string, kv ...string) string { text, ok := signinCopy[id] if !ok { panic("console: unknown copy id " + id) } if len(kv)%2 != 0 { panic("console: copyText " + id + ": odd number of placeholder arguments") } pairs := make([]string, 0, len(kv)) for i := 0; i < len(kv); i += 2 { pairs = append(pairs, "{"+kv[i]+"}", kv[i+1]) } return strings.NewReplacer(pairs...).Replace(text) }