From c6f6db1056a5cf0af3dc0add0610e0b39962996e Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Wed, 6 Aug 2025 14:11:48 +0800 Subject: [PATCH] don't append empty path to redirect --- next-ui/src/router/login-guard.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/next-ui/src/router/login-guard.ts b/next-ui/src/router/login-guard.ts index 862b48f9..f7da1e9c 100644 --- a/next-ui/src/router/login-guard.ts +++ b/next-ui/src/router/login-guard.ts @@ -10,7 +10,11 @@ export function useLoginGuard(router: Router) { const { data } = useCurrentUser() const authenticated = data.value if (!authenticated) { - const query = Object.assign({}, to.query, { redirect: to.fullPath }) + const query = Object.assign( + {}, + to.query, + to.fullPath !== '/' ? { redirect: to.fullPath } : {}, + ) return { name: '/startup', query: query } } }