Skip to content

Commit c97f192

Browse files
authored
fixes refresh issue (#25616)
1 parent dea6ec5 commit c97f192

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

apps/web/modules/onboarding/hooks/useSubmitOnboarding.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { useSession } from "next-auth/react";
2-
import { useRouter } from "next/navigation";
31
import { useState } from "react";
42

53
import { setShowNewOrgModalFlag } from "@calcom/features/ee/organizations/hooks/useWelcomeModal";
@@ -11,8 +9,6 @@ import { showToast } from "@calcom/ui/components/toast";
119
import type { OnboardingState } from "../store/onboarding-store";
1210

1311
export const useSubmitOnboarding = () => {
14-
const router = useRouter();
15-
const { update: updateSession } = useSession();
1612
const [isSubmitting, setIsSubmitting] = useState(false);
1713
const [error, setError] = useState<string | null>(null);
1814
const flags = useFlagMap();
@@ -80,8 +76,6 @@ export const useSubmitOnboarding = () => {
8076
// No checkout URL means billing is disabled (self-hosted flow)
8177
// Organization has already been created by the backend
8278
showToast("Organization created successfully!", "success");
83-
// Refresh session to get updated organization data
84-
await updateSession();
8579
// Set flag to show welcome modal after personal onboarding redirect
8680
setShowNewOrgModalFlag();
8781
skipToPersonal(resetOnboarding);
@@ -98,7 +92,9 @@ export const useSubmitOnboarding = () => {
9892
const skipToPersonal = (resetOnboarding: () => void) => {
9993
resetOnboarding();
10094
const gettingStartedPath = flags["onboarding-v3"] ? "/onboarding/personal/settings" : "/getting-started";
101-
router.push(gettingStartedPath);
95+
// Use window.location.href for a full page reload to ensure JWT callback runs
96+
// without trigger="update", which will call autoMergeIdentities() and fetch org data
97+
window.location.href = gettingStartedPath;
10298
};
10399

104100
return {

0 commit comments

Comments
 (0)