Skip to content

Conversation

@mcull
Copy link
Owner

@mcull mcull commented Sep 29, 2025

Summary

Routes guest Join → sign-in through so the post-auth callback can consume invite cookies server-side and create membership. This aligns the flow with expectations: preview as guest → join → sign-in → profile (if needed) → return as member.

Changes

  • : when Join returns 401 (not logged in), redirect to instead of returning directly to the collection. The callback then:
    • Calls to upsert membership, mark invite accepted, and clear cookies.
    • Sends users with incomplete profiles to .
  • (Already on main) and auth callback integration are in place.

Why

Previously, Join while signed out sent users back to the collection with invite cookies still present, but without converting them to members — they appeared as guests again. Routing through the callback guarantees the invite is consumed server-side immediately after auth.

Test Plan

  1. Open while signed out → see guest banner on the collection page.
  2. Click “Join Library” → redirected to sign-in via .
  3. Enter email → receive code → enter code.
  4. If profile incomplete, complete profile; otherwise skip.
  5. Land on as a member (no guest banner).

@vercel
Copy link

vercel bot commented Sep 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
stufflibrary Ready Ready Preview Comment Oct 21, 2025 5:27am

💡 Enable Vercel Agent with $100 free credit for automated AI reviews

@mcull mcull merged commit 1d86a77 into main Oct 21, 2025
4 checks passed
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.

2 participants