Skip to content

Commit

Permalink
fix(dashboard): implement redirect to legacy studio auth page (#7313)
Browse files Browse the repository at this point in the history
  • Loading branch information
BiswaViraj authored Dec 17, 2024
1 parent 3678a0c commit c27185e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
10 changes: 3 additions & 7 deletions apps/dashboard/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
ActivityFeed,
} from '@/pages';
import './index.css';
import { LEGACY_ROUTES, ROUTES } from './utils/routes';
import { ROUTES } from './utils/routes';
import { EditWorkflowPage } from './pages/edit-workflow';
import { TestWorkflowPage } from './pages/test-workflow';
import { initializeSentry } from './utils/sentry';
Expand All @@ -30,6 +30,7 @@ import { ChannelPreferences } from './components/workflow-editor/channel-prefere
import { FeatureFlagsProvider } from './context/feature-flags-provider';
import { ConfigureStep } from '@/components/workflow-editor/steps/configure-step';
import { ConfigureStepTemplate } from '@/components/workflow-editor/steps/configure-step-template';
import { RedirectToLegacyStudioAuth } from './pages/redirect-to-legacy-studio-auth';

initializeSentry();
overrideZodErrorMap();
Expand Down Expand Up @@ -159,12 +160,7 @@ const router = createBrowserRouter([
},
{
path: ROUTES.LOCAL_STUDIO_AUTH,
element: (() => {
const currentSearch = window.location.search;
window.location.href = `${LEGACY_ROUTES.LOCAL_STUDIO_AUTH}${currentSearch}&studio_path_hint=/legacy/studio`;

return null;
})(),
element: <RedirectToLegacyStudioAuth />,
},
{
path: '*',
Expand Down
12 changes: 12 additions & 0 deletions apps/dashboard/src/pages/redirect-to-legacy-studio-auth.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { useEffect } from 'react';
import { LEGACY_ROUTES } from '@/utils/routes';

export const RedirectToLegacyStudioAuth = () => {
useEffect(() => {
const currentSearch = window.location.search;
const redirectUrl = `${LEGACY_ROUTES.LOCAL_STUDIO_AUTH}${currentSearch}&studio_path_hint=/legacy/studio`;
window.location.href = redirectUrl;
}, []);

return null;
};

0 comments on commit c27185e

Please sign in to comment.