mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-11 12:22:26 +00:00
25 lines
549 B
TypeScript
25 lines
549 B
TypeScript
"use client";
|
|
|
|
import { useEffect } from "react";
|
|
import { useRouter } from "next/navigation";
|
|
import { consumeInternalRedirectPath } from "@app/lib/internalRedirect";
|
|
|
|
type ApplyInternalRedirectProps = {
|
|
orgId: string;
|
|
};
|
|
|
|
export default function ApplyInternalRedirect({
|
|
orgId
|
|
}: ApplyInternalRedirectProps) {
|
|
const router = useRouter();
|
|
|
|
useEffect(() => {
|
|
const path = consumeInternalRedirectPath();
|
|
if (path) {
|
|
router.replace(`/${orgId}${path}`);
|
|
}
|
|
}, [orgId, router]);
|
|
|
|
return null;
|
|
}
|