fix(auth): keep sign-up invite only when the auth hook is not enabled

Đang mở
#765 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
50/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
next.js, playwright, postgresql, supabase, typescript

Hướng nghiên cứu

Read #143 first because it determines where the open-sign-up setting lives, then inspect the user trigger migration, src/app/auth/, and src/app/super-admin/page.tsx. Add the invite check, admin status, pgTAP coverage, and the Playwright refusal-message test with an axe scan. Done means the acceptance criteria pass; run the listed typecheck, lint, database tests, and sign-in e2e spec.

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

Mô tả

area: auth bug impact: medium priority: P2 size: S

Context

Decide together with #143: this is the guard that makes opening sign-up a deliberate act rather than a missed toggle.

Found by the Fable pre-production review on 2026-12-02 (main at cedc1914; every line reference below re-checked on main at cde5aa3b). Source: deploy readiness report, new issue 8.

The before-user-created hook is the only gate on sign-up: hook_before_user_created admits an email only when it is in public.access_invites (supabase/migrations/20261031090300_jobs_and_invites.sql:136-162). On a hosted project the hook is a dashboard switch (docs/operations/deploy.md:115-122). Sign-ups are on (supabase/config.toml:194), the user trigger creates a personal workspace for every new user regardless (supabase/migrations/20261031090000_tenancy.sql:295-296), and no app code reads access_invites at sign-in (only account deletion and the demo seed touch it).

Impact: if the hook is missed at setup or turned off later, any GitHub account can sign up, get a workspace, and connect providers, and nothing in the app shows that the instance is open. #756 adds a deploy check; this makes the app itself refuse.

Plan

  1. Decide with #143 where the second check lives: the user trigger refusing an uninvited email unless an explicit "open sign-up" setting is on, or a check in the sign-in callback before a workspace is created.
  2. Implement it so that with the hook off, an uninvited sign-up is refused, and with the setting that #143 introduces, sign-up opens on purpose.
  3. Show "Sign-up is open" or "Invite only" on /app/admin.

Acceptance criteria

  • With the hook off locally, an uninvited sign-up is refused and an invited one passes (pgTAP).
  • With the #143 setting on, an uninvited sign-up passes.
  • /app/admin says whether sign-up is open.
  • Playwright e2e for the refusal message, with an axe scan.

Files and areas

A migration on the user trigger or the sign-in callback (src/app/auth/), src/app/super-admin/page.tsx, pgTAP tests, docs/operations/deploy.md.

Non-goals: abuse protection (#91 part c), the sign-up copy changes listed on #143.

Verification

npm run typecheck, npm run lint, npm run test:db, the sign-in e2e spec.


Branch: <issue-number>-invite-only-without-hook

Model: anthropic/claude-opus-5-5 | Reasoning effort: unknown

Ngôn ngữ chính
TypeScript
Star
13
Fork
2
Merge trung bình
5 giờ 20 phút
Pull request đã merge (30 ngày)
287

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của eddiejaoude/StackDash

Tất cả issue của eddiejaoude/StackDash

Issue tương tự

Thêm issue về TypeScript

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.