mirror of
https://github.com/formbricks/formbricks.git
synced 2026-05-24 08:49:01 -05:00
fix: onboarding survey link (#2815)
This commit is contained in:
committed by
GitHub
parent
fc150f8860
commit
cea5716c48
+3
-2
@@ -9,9 +9,10 @@ import { TProductConfigChannel } from "@formbricks/types/product";
|
||||
interface OnboardingSurveyProps {
|
||||
organizationId: string;
|
||||
channel: TProductConfigChannel;
|
||||
userId: string;
|
||||
}
|
||||
|
||||
export const OnboardingSurvey = ({ organizationId, channel }: OnboardingSurveyProps) => {
|
||||
export const OnboardingSurvey = ({ organizationId, channel, userId }: OnboardingSurveyProps) => {
|
||||
const [isIFrameVisible, setIsIFrameVisible] = useState(false);
|
||||
const [fadeout, setFadeout] = useState(false);
|
||||
const router = useRouter();
|
||||
@@ -44,7 +45,7 @@ export const OnboardingSurvey = ({ organizationId, channel }: OnboardingSurveyPr
|
||||
<div className="relative h-[60vh] w-[50vh] overflow-auto">
|
||||
<iframe
|
||||
onLoad={() => setIsIFrameVisible(true)}
|
||||
src="https://app.formbricks.com/s/clxcwr22p0cwlpvgekzdab2x5?embed=true"
|
||||
src={`https://app.formbricks.com/s/clxcwr22p0cwlpvgekzdab2x5?embed=true&userId=${userId}`}
|
||||
className="absolute left-0 top-0 h-full w-full overflow-visible border-0"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+11
-2
@@ -1,5 +1,7 @@
|
||||
import { OnboardingSurvey } from "@/app/(app)/(onboarding)/organizations/[organizationId]/products/new/survey/components/OnboardingSurvey";
|
||||
import { notFound } from "next/navigation";
|
||||
import { getServerSession } from "next-auth";
|
||||
import { notFound, redirect } from "next/navigation";
|
||||
import { authOptions } from "@formbricks/lib/authOptions";
|
||||
import { TProductConfigChannel, TProductConfigIndustry } from "@formbricks/types/product";
|
||||
|
||||
interface OnboardingSurveyPageProps {
|
||||
@@ -13,11 +15,18 @@ interface OnboardingSurveyPageProps {
|
||||
}
|
||||
|
||||
const Page = async ({ params, searchParams }: OnboardingSurveyPageProps) => {
|
||||
const session = await getServerSession(authOptions);
|
||||
if (!session) {
|
||||
return redirect(`/auth/login`);
|
||||
}
|
||||
|
||||
const channel = searchParams.channel;
|
||||
const industry = searchParams.industry;
|
||||
if (!channel || !industry) return notFound();
|
||||
|
||||
return <OnboardingSurvey organizationId={params.organizationId} channel={channel} />;
|
||||
return (
|
||||
<OnboardingSurvey organizationId={params.organizationId} channel={channel} userId={session.user.id} />
|
||||
);
|
||||
};
|
||||
|
||||
export default Page;
|
||||
|
||||
Reference in New Issue
Block a user