diff --git a/examples/auth/app/auth/pages/login.tsx b/examples/auth/app/auth/pages/login.tsx
index 03822ce91f..a4ad8e3d09 100644
--- a/examples/auth/app/auth/pages/login.tsx
+++ b/examples/auth/app/auth/pages/login.tsx
@@ -10,7 +10,7 @@ const LoginPage: BlitzPage = () => {
{
- const next = (router.query.next as string) ?? "/"
+ const next = router.query.next ? decodeURIComponent(router.query.next as string) : "/"
router.push(next)
}}
/>
diff --git a/packages/generator/templates/app/app/auth/pages/login.tsx b/packages/generator/templates/app/app/auth/pages/login.tsx
index 45e76ff569..de51b126df 100644
--- a/packages/generator/templates/app/app/auth/pages/login.tsx
+++ b/packages/generator/templates/app/app/auth/pages/login.tsx
@@ -9,7 +9,7 @@ const LoginPage: BlitzPage = () => {
{
- const next = (router.query.next as string) ?? "/"
+ const next = router.query.next ? decodeURIComponent(router.query.next as string) : "/"
router.push(next)
}}
/>