Skip to content

fix: redirect unauthenticated check-in users to /check-in/login instead of /login#12

Draft
tasaboia with Copilot wants to merge 1 commit into
mainfrom
copilot/fix-check-in-redirect-issue
Draft

fix: redirect unauthenticated check-in users to /check-in/login instead of /login#12
tasaboia with Copilot wants to merge 1 commit into
mainfrom
copilot/fix-check-in-redirect-issue

Conversation

Copilot AI commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Unauthenticated users visiting any /check-in private route were redirected to the leaders /login page, which immediately bounced them to /leaders-onboarding because no leader onboarding context (onboardingData.location.id) was present.

Change

src/middleware.ts — added a path-based branch in the unauthenticated redirect logic:

if (!session && !isPublicPage) {
  const isCheckInPath = pathname.includes("/check-in");
  if (isCheckInPath) {
    return NextResponse.redirect(new URL(`/${locale}/check-in/login`, req.url));
  }
  return NextResponse.redirect(new URL(`/${locale}/login`, req.url));
}

Check-in users now land on /check-in/login (which handles Google OAuth with an eventId), while all other unauthenticated access still goes to the leaders /login.

…ad of leaders /login

Agent-Logs-Url: https://github.com/tasaboia/P40/sessions/d96bc918-5e17-401d-89f6-3a852511db78

Co-authored-by: tasaboia <11961423+tasaboia@users.noreply.github.com>
@vercel

vercel Bot commented Apr 25, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
intercessao Ready Ready Preview, Comment Apr 25, 2026 8:38pm
p40 Ready Ready Preview, Comment Apr 25, 2026 8:38pm

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