Skip to content

Add agreement management UI and improve markdown rendering - #291

Merged
bokelley merged 1 commit into
mainfrom
bokelley/terms-of-service-1.1
Dec 12, 2025
Merged

bokelley merged 1 commit into
mainfrom
bokelley/terms-of-service-1.1

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

  • Converted Word documents (Terms of Service, Privacy Policy) to markdown format (v1.1)
  • Added View and Edit buttons to the admin agreements page for better usability
  • Improved CSS spacing for markdown rendering in both preview and public views to eliminate text squishing

What's New

The admin agreements interface now displays each agreement with explicit View and Edit buttons, making it easier to access and manage different versions. The markdown rendering CSS has been updated to properly handle spacing between headers and paragraphs, eliminating the collapsed margin issue.

Testing

All schema validation, example validation, unit tests, and TypeScript type checks pass.

- Added View button alongside Edit button on agreements list
- Fixed CSS margin collapsing for rendered markdown in preview pane
- Fixed CSS margins for public agreement rendering endpoint

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@bokelley
bokelley force-pushed the bokelley/terms-of-service-1.1 branch from b6babbe to bddc05c Compare December 12, 2025 12:39
@bokelley
bokelley merged commit 245a782 into main Dec 12, 2025
bokelley added a commit that referenced this pull request May 1, 2026
… + Pia (#291) (#3744)

* feat(identity): admin link-existing + unlink credential (Phase 2b cont.)

Three new admin operations on /api/admin/users/:userId/credentials:

  GET    /credentials               — list bindings for this user's identity
  POST   /credentials               — bind an EXISTING WorkOS user by id
  DELETE /credentials/:credentialId — unbind (creates fresh singleton identity)

POST bypasses createUser entirely, which fixes the case Brian hit on Ahmed:
WorkOS still had user_01KG39QAWFMHE22MVT3XB6289S alive at [email protected]
(the April merge's delete-secondary call had silently failed), so createUser
returned 400 "Could not create user." Workflow is now: find the existing
WorkOS user id in the WorkOS Dashboard, paste into "Link existing WorkOS user."

DELETE is the unbind half — non-destructive (WorkOS user stays alive). Closes
the Pia escalation (#291: "I want to remove a linked email"). Refuses on the
primary credential to keep the host signed-in.

UI on /admin/people detail panel now shows the bound credentials list with
per-row Remove buttons (non-primary only), plus a "+ Link existing WorkOS
user" action alongside "+ Add sign-in email."

Existing /linked-emails (create-and-bind) error handler now surfaces the
real WorkOS error message instead of a generic "502 upstream" — including
the 400-BadRequest-on-already-exists case — and points admins at the new
"Link existing" tool.

Closes #3719 (admin consolidate-existing path).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* fix(identity): address Phase 2b cont security findings

Security review caught three improvements (no blockers):

M1 — silent consolidation foot-gun. POST /credentials would happily move
all of a credential's app-state (org memberships, working-group memberships,
certification work, community points) onto the host without distinguishing
"fresh credential" from "real account being absorbed." Now refuses with
409 + consolidate_confirmation_required when cred has app-state, requiring
{"consolidate": true} in the body to proceed. UI escalates the prompt and
makes admin type CONSOLIDATE in caps to confirm.

M2 — audit forensics. unbind_credential audit row now records
acting_workos_user_id (the actual auth credential, separate from the
post-id-swap canonical id) in details so admins with multiple bound
credentials are distinguishable. Issue #3717 still tracks the broader
audit-log overhaul; this is the local fix.

L1 — unbind UI confirmation now requires typing the credential's email
exactly, matching the strength of the link confirmation. Defends against
admin accidentally removing the wrong credential.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* fix(scan): drop raw err.message from admin credential error responses

Semgrep flagged the (err as Error).message echo in the link/unlink error
paths — defense-in-depth concern noted in the security review (L2).
Removed; the full error is still logged via logger.error.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant