fix sidebar menu redirect in production
Build & Deploy / Build & Push Docker Image (push) Successful in 3m15s
Test / Type Check (all packages) (push) Successful in 55s
Build & Deploy / Deploy to VPS (push) Successful in 4s
Test / API Unit Tests (push) Successful in 47s
Test / Homepage Unit Tests (push) Successful in 42s
Test / Carplace Unit Tests (push) Successful in 44s
Test / Admin Unit Tests (push) Successful in 42s
Test / Dashboard Unit Tests (push) Successful in 40s
Test / API Integration Tests (push) Successful in 59s

This commit is contained in:
root
2026-07-02 21:43:56 -04:00
parent 511ab4d03b
commit c27f0909df
4 changed files with 18 additions and 5 deletions
@@ -3,7 +3,7 @@
import { usePathname, useRouter } from 'next/navigation'
import { useEffect, useState } from 'react'
import { apiFetch } from '@/lib/api'
import { toDashboardAppPath } from '@/lib/dashboardPaths'
import { toDashboardAppPath, toPublicDashboardPath } from '@/lib/dashboardPaths'
import {
getDashboardFallbackRoute,
resolveDashboardRoutePolicy,
@@ -90,9 +90,9 @@ export function resolveAccessRedirect(currentPath: string, allowedRoutes: string
return fallbackRoute === currentPath ? null : fallbackRoute
}
function buildSignInRedirect(currentPath: string) {
export function buildSignInRedirect(currentPath: string) {
const params = new URLSearchParams()
params.set('redirect', currentPath)
params.set('redirect', toPublicDashboardPath(currentPath))
return `/sign-in?${params.toString()}`
}