feat: redirect on add credentials page if there is no provider associated

This commit is contained in:
Pablo Lara
2024-10-30 17:30:29 +01:00
parent 37343750cd
commit d0b5992146
@@ -1,11 +1,16 @@
import { redirect } from "next/navigation";
import React from "react";
import { AddCredentialsForm } from "@/components/providers/workflow/forms";
export default function AddCredentialsPage({
searchParams,
}: {
interface Props {
searchParams: { provider: string; id: string };
}) {
}
export default function AddCredentialsPage({ searchParams }: Props) {
if (!searchParams.provider || !searchParams.id) {
redirect("/providers/connect-account");
}
return <AddCredentialsForm searchParams={searchParams} />;
}