Repository navigation
An invitee whose invite can't be read or used is asked to sign in again, instead of let in with no household (#240) - #247
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…in, instead of let in with no household (#240) When the membership read found none but the invite read failed, or adding the invited person to the household did, lib/access.ts let the sign-in through. The invited partner then reached the app with no household, and the invite went unused, until they happened to sign out and in again. ensureHouseholdAccess now answers 'let-in', 'try-again' or 'not-invited'. On 'try-again', app/auth/confirm/route.ts signs the new session out locally and sends them to /auth/try-again, as it already does when Supabase Auth can't be asked, and signing in again runs the check again. The account and the invite are kept, and both cases are logged. A failed membership read still lets the sign-in through. An existing member gets past a passing failure, and RLS still guards the data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and the try-again words fit both causes (#240) From the review of #247: - Two first sign-ins at once: the second insert of the membership hits the unique key. That person is a member, so they're let in and the invite is used up, rather than asked to sign in again. - When using up the invite fails after the membership was made, they're still let in, and it's logged. The invite left behind would add them back if they were ever removed by hand (#248). - The try-again page said "Something went wrong reaching the sign-in service". In #240's cases the database failed, not the sign-in service, so it now says "Something went wrong while signing you in." - A test with the real Supabase client shows that a local sign-out clears every cookie a sign-in earlier in the same request wrote, including a session split across cookies. Both try-again paths rely on that, and before, only a cookie that came with the request was tested. - Comments that still said sign-in fails open, in lib/household.ts and seven tests, now say it lets an account through when it can't read the membership. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
smilne3
force-pushed
the
fix/240-invitee-try-again
branch
from
November 5, 2026 16:32
fb12c0d to
0596a6b
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This finishes #240, using the option recommended there. An invited partner whose first sign-in couldn't read or use their invite used to get into the app with no household. Now they're asked to sign in again.
What changes for you
Nothing for you or anyone already in the household. The change is for someone signing in for the first time with an invite, when the database fails at that moment:
The last row is unchanged on purpose. Asking everyone to sign in again when that read fails would also stop existing members, and row-level security still keeps anyone from data that isn't theirs.
The "Sign-in couldn't be completed" page now says "Something went wrong while signing you in." It used to say "reaching the sign-in service", which isn't true when the database is what failed.
How
lib/access.ts:ensureHouseholdAccessanswers'let-in','try-again'or'not-invited'instead of true or false.'try-again'means not a member, and their invite couldn't be read, or adding them failed.[access] … so ask them to sign in againwith the error.app/auth/confirm/route.ts: on'try-again', it signs the new session out locally and then redirects to/auth/try-again. That's what it already does when Supabase Auth can't be asked (A Supabase auth outage signs everyone out: proxy.ts treats any getUser() error as "no user" #143). Kept, the new session's cookie would let them into the app with no household.Checked
'try-again', deletes no one, keeps the invite and logs it.'try-again'to "Sign-in couldn't be completed", and signs out before it answers.Review
Sign-in failure paths: nothing Critical.
next startagainst a local stand-in for Supabase. On'try-again', the redirect cleared the session cookie in every run: after a failed invite read, after a failed insert, and with a session split across two cookies while Supabase Auth was unreachable.lib/household.tsand seven tests that still said sign-in lets someone through whenever it can't check, and three inlib/access.tsFound along the way
The review filed two issues it found, both from before this PR:
Closes #240.
🤖 Generated with Claude Code