Skip to content

Enforce optional group PINs on the server - #613

Open
t0ma5 wants to merge 3 commits into
spliit-app:mainfrom
t0ma5:pr/server-enforced-pin
Open

Enforce optional group PINs on the server#613
t0ma5 wants to merge 3 commits into
spliit-app:mainfrom
t0ma5:pr/server-enforced-pin

Conversation

@t0ma5

@t0ma5 t0ma5 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Optional 6–8 digit group PIN, hashed with PBKDF2 (pinHash is never returned to clients).
  • Unlock is an HTTP-only HMAC cookie (PIN_SECRET). tRPC group procedures and CSV/JSON export require it.
  • Failed attempts are rate-limited in Postgres (PinAttempt).

Fixes #373 — the PIN is no longer a UI-only check.

Run prisma migrate deploy after merge. Set PIN_SECRET (16+ chars) in production if any group uses a PIN.

Test plan

  • Create a group without a PIN; expenses still work.
  • Set a PIN on a group, open the URL in a private window; the unlock dialog appears and expenses/export return 401 until the PIN is entered.
  • After a correct PIN, the HTTP-only cookie is set and the group loads. Changing/clearing the PIN requires the current PIN.
  • Eight failed attempts lock further tries for 15 minutes.

t0ma5 and others added 3 commits August 30, 2026 17:42
Addresses spliit-app#373: PIN is no longer a client-only gate. New PINs are PBKDF2, unlock is a signed cookie, and tRPC plus CSV/JSON export require it.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.

Simple pin protected group access

1 participant