Skip to content

Commit

Permalink
Merge pull request #1032 from tailwarden/fix-unnecessary-redirect
Browse files Browse the repository at this point in the history
fix: prevent redirecting when not visiting the onboarding wizard
  • Loading branch information
mlabouardy authored Oct 4, 2023
2 parents ad517d8 + c848d5f commit 72346a7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dashboard/components/layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ function Layout({ children }: LayoutProps) {

useEffect(() => {
settingsService.getOnboardingStatus().then(res => {
if (res.onboarded === true && res.status === 'COMPLETE') {
if (
res.onboarded === true &&
res.status === 'COMPLETE' &&
router.asPath.includes('/onboarding/')
) {
router.replace('/dashboard/');
} else if (res.onboarded === false && res.status === 'PENDING_DATABASE') {
router.replace('/onboarding/choose-database');
Expand Down

0 comments on commit 72346a7

Please sign in to comment.