From 061a54dadd45b23703b3dc72e587fced02afa289 Mon Sep 17 00:00:00 2001 From: Henry <30578846+hjball@users.noreply.github.com> Date: Sat, 6 Sep 2025 22:51:39 +0100 Subject: [PATCH] fix: extract memberPublicId from callbackURL after accepting invitation (#165) --- packages/auth/src/auth.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/auth/src/auth.ts b/packages/auth/src/auth.ts index e91eae1a..9822f271 100644 --- a/packages/auth/src/auth.ts +++ b/packages/auth/src/auth.ts @@ -328,13 +328,13 @@ export const initAuth = (db: dbClient) => { ctx.path === "/magic-link/verify" && (ctx.query?.callbackURL as string | undefined)?.includes( "type=invite", - ) && - ctx.query?.memberPublicId + ) ) { const userId = ctx.context.newSession?.session.userId; - const memberPublicId = ctx.query.memberPublicId as string; + const callbackURL = ctx.query?.callbackURL as string | undefined; + const memberPublicId = callbackURL?.split("memberPublicId=")[1]; - if (userId) { + if (userId && memberPublicId) { const member = await memberRepo.getByPublicId(db, memberPublicId); if (member?.id) {