CodeForPhilly / CodeForPhilly/codeforphilly-ng

auth: 'Sign out all devices' — expose sign-out-everywhere sentinel

Đang mở
#112 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
1
Fork
1
Merge trung bình
5 ngày 3 giờ
Pull request đã merge (30 ngày)
9

Mô tả

## What's missing

\`specs/behaviors/authorization.md\` describes a \`jti = '*'\` sentinel in the revocations sheet that revokes every JWT for a personId whose \`iat\` precedes the sentinel's \`revokedAt\`. The verifier-side code at \`apps/api/src/auth/revocation.ts\` fully implements the sentinel.

**But there's no way for a user to trigger it.** No API endpoint exposes "sign out all devices," and the Account screen (\`specs/screens/account.md\`) only offers "Sign out of this session." A user whose phone is lost can revoke that one session but can't blast every JWT issued before now.

## Fix shape

1. Add \`POST /api/auth/logout-all\` (or \`POST /api/auth/sessions/revoke-all\`) — writes a sentinel \`Revocation\` with \`jti = '*'\`, \`personId = caller.id\`, \`revokedAt = now\`.
2. Add a "Sign out of all devices" button to the Account settings screen (\`apps/web/src/screens/Account.tsx\`).
3. Update \`specs/api/auth.md\` endpoints table + \`specs/screens/account.md\` Actions table.

## Why it's worth the work

Compromised-device recovery is a real account-security need. The hard part (the verifier-side sentinel) is already done; this is just plumbing.

Identified during the 2026-05-30 post-cutover-blog spec-drift audit.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Bắt đầu với apps/api/src/auth/revocation.ts và specs/behaviors/authorization.md để hiểu sentinel '*' hiện có, sau đó kiểm tra cấu trúc API auth endpoint và apps/web/src/screens/Account.tsx. Công việc hoàn tất khi người dùng đã xác thực có thể kích hoạt việc thu hồi trên tất cả thiết bị, màn hình Account cung cấp thao tác này, và endpoint cùng các bảng action được cập nhật trong specs/api/auth.md và specs/screens/account.md.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
typescript
Lĩnh vực
api, authentication, documentation, frontend
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
68/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.