Skip to content

Commit 2963124

Browse files
committed
fix(middleware): redirect org users with completed profile away from org signup flow to org dashboard
1 parent 699cc0c commit 2963124

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

middleware.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ export async function middleware(req: NextRequest) {
121121
if (pathname.startsWith(USER_SIGNUP_PREFIX)) {
122122
return redirect(ORG_DASHBOARD_PATH);
123123
}
124+
// If org profile is already complete, redirect away from any org signup routes to dashboard
125+
if (profileComplete && pathname.startsWith(ORG_SIGNUP_PREFIX)) {
126+
return redirect(ORG_DASHBOARD_PATH);
127+
}
124128
// Orgs should not access user dashboard or profile page
125129
if (onUserDashboard || onProfile) return redirect(ORG_DASHBOARD_PATH);
126130
}

0 commit comments

Comments
 (0)