diff --git a/app/main.py b/app/main.py index a48aeeb..40b5141 100644 --- a/app/main.py +++ b/app/main.py @@ -280,8 +280,8 @@ async def api_guests(request: Request): One hop to the portal broker's GET /broker/guests: whether this member can send a guest invitation now (the rolling one-per-30-days rule, - counting pending and approved requests) and every invitation they have - made, with its status. The portal's refusal statuses pass through as-is. + counted from the guests ledger) and every invitation they have made, + with its status. The portal's refusal statuses pass through as-is. """ identity = get_user_identity(request) if not identity: @@ -297,10 +297,10 @@ async def api_guest_invite(request: Request): Body: {"email": "", "name": ""}. One hop to the portal broker, which holds every protection (active-member inviter, one invitation per member per 30 days, recipient never an - existing member / prior guest / pending request / manual account) and - the trial gate: with approval on, the request waits for the co-op's - approve/reject and nothing goes to the recipient until then. The - portal's refusals are member-facing text and pass through verbatim. + existing member / prior guest / manual account) and PROVISIONS + IMMEDIATELY on a valid request — the friend's account and invitation + email go out at once (the trial-approval gate was removed 2026-11-08). + The portal's refusals are member-facing text and pass through verbatim. """ identity = get_user_identity(request) if not identity: @@ -644,7 +644,6 @@ PAGE_HTML = """ .guest-who { font-weight: 600; font-size: 13px; } .guest-meta { color: var(--muted); font-size: 12px; margin-top: 2px; } .gpill { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; } - .gpill.pending { background: #fdf3e3; color: #a97a2a; } .gpill.ok { background: #eaf3ea; color: #2f5c30; } .gpill.done { background: #f1e8da; color: #a97a4a; } .gpill.bad { background: #f6e9e5; color: var(--danger); } @@ -949,11 +948,11 @@ function renderGuestEnded(g) { // --- Member self-serve guest access ---------------------------------------- // One invitation per member per rolling 30 days (the portal owns the rule); -// under the trial gate a request waits for the co-op's approval before the -// friend's account is created. The trail is the member's own history only. +// an invitation provisions immediately — the friend's account and invitation +// email go out at once (the trial-approval gate was removed 2026-11-08). +// The trail is the member's own history only. const GUEST_STATUS_LABELS = { - pending: ['pending approval', 'pending'], rejected: ['not approved', 'bad'], active: ['active guest', 'ok'], converted: ['became a member', 'done'], @@ -992,15 +991,10 @@ function renderGuests(d) { $('guest-trail').innerHTML = '
' + escapeHtml(d.error) + '
'; return; } - // The gate: with auto-approve on the invitation sends directly; under the - // trial it waits for the co-op's approval. The button says which. - const auto = !!d.auto_approve; - $('guest-btn').textContent = auto ? 'Send invite' : 'Send request'; - if (auto) { - $('guest-hint').textContent = "Give a friend $2 of AI credits for the co-op's chat and API — no membership needed. They get 60 days to try it. One guest per member every 30 days."; - } else { - $('guest-hint').textContent = "Give a friend $2 of AI credits for the co-op's chat and API — no membership needed. They get 60 days to try it. One guest per member every 30 days. The co-op approves guest requests before the account is created."; - } + // An invitation provisions immediately (the approval gate is gone) — the + // button and hint say what happens, with no approval step. + $('guest-btn').textContent = 'Send invite'; + $('guest-hint').textContent = "Give a friend $2 of AI credits for the co-op's chat and API — no membership needed. They get 60 days to try it. One guest per member every 30 days."; if (d.eligible) { $('guest-allowance').textContent = 'You can send one guest invitation now.'; } else if (d.next_eligible_at) { @@ -1029,8 +1023,8 @@ function renderGuests(d) { // The standard guest-invite form: the guest's email (required) plus an // OPTIONAL display name. The inviter is the logged-in member — automatic, no // field; the portal applies the member-side protections (active member, one -// per 30 days, recipient checks) and, with the trial gate on, holds the -// request for approval. An empty name is never derived from the email. +// per 30 days, recipient checks) and a valid invitation provisions +// immediately. An empty name is never derived from the email. async function sendGuestInvite(ev) { if (ev) ev.preventDefault(); const email = ($('guest-email').value || '').trim(); @@ -1047,15 +1041,15 @@ async function sendGuestInvite(ev) { }); const d = await r.json().catch(() => ({})); if (!r.ok || d.error) { - flash(d.detail || d.note || d.error || 'Could not send the request', false); + flash(d.detail || d.note || d.error || 'Could not send the invitation', false); return; } $('guest-email').value = ''; $('guest-name').value = ''; - flash(d.note || 'Request sent — waiting for approval.', true); + flash(d.note || 'Invitation sent — your friend can set up their account now.', true); await loadGuests(); } catch (e) { - flash('Could not send the request: ' + e.message, false); + flash('Could not send the invitation: ' + e.message, false); } finally { btn.disabled = false; btn.textContent = label;