diff --git a/backend/app/api/oauth.py b/backend/app/api/oauth.py
index 0c03e50..68598f7 100644
--- a/backend/app/api/oauth.py
+++ b/backend/app/api/oauth.py
@@ -203,7 +203,7 @@ async def google_callback(
)
# Parse redirect from state
- redirect_path = "/dashboard"
+ redirect_path = "/command/dashboard"
if ":" in state:
_, redirect_path = state.split(":", 1)
@@ -312,7 +312,7 @@ async def github_callback(
)
# Parse redirect from state
- redirect_path = "/dashboard"
+ redirect_path = "/command/dashboard"
if ":" in state:
_, redirect_path = state.split(":", 1)
diff --git a/frontend/src/app/command/dashboard/page.tsx b/frontend/src/app/command/dashboard/page.tsx
index b7b4d13..8cdd5be 100644
--- a/frontend/src/app/command/dashboard/page.tsx
+++ b/frontend/src/app/command/dashboard/page.tsx
@@ -63,7 +63,7 @@ export default function DashboardPage() {
useEffect(() => {
if (searchParams.get('upgraded') === 'true') {
showToast('Welcome to your upgraded plan! 🎉', 'success')
- window.history.replaceState({}, '', '/dashboard')
+ window.history.replaceState({}, '', '/command/dashboard')
}
}, [searchParams])
diff --git a/frontend/src/app/login/page.tsx b/frontend/src/app/login/page.tsx
index 30b5018..c803cf3 100644
--- a/frontend/src/app/login/page.tsx
+++ b/frontend/src/app/login/page.tsx
@@ -54,8 +54,17 @@ function LoginForm() {
const [oauthProviders, setOauthProviders] = useState({ google_enabled: false, github_enabled: false })
const [verified, setVerified] = useState(false)
- // Get redirect URL from query params
- const redirectTo = searchParams.get('redirect') || '/command/dashboard'
+ // Get redirect URL from query params or localStorage (set during registration)
+ const paramRedirect = searchParams.get('redirect')
+ const [redirectTo, setRedirectTo] = useState(paramRedirect || '/command/dashboard')
+
+ // Check localStorage for redirect (set during registration before email verification)
+ useEffect(() => {
+ const storedRedirect = localStorage.getItem('pounce_redirect_after_login')
+ if (storedRedirect && !paramRedirect) {
+ setRedirectTo(storedRedirect)
+ }
+ }, [paramRedirect])
// Check for verified status
useEffect(() => {
@@ -88,6 +97,9 @@ function LoginForm() {
return
}
+ // Clear stored redirect (was set during registration)
+ localStorage.removeItem('pounce_redirect_after_login')
+
// Redirect to intended destination or dashboard
router.push(redirectTo)
} catch (err: unknown) {
diff --git a/frontend/src/app/oauth/callback/page.tsx b/frontend/src/app/oauth/callback/page.tsx
index 0125153..c5d39d0 100644
--- a/frontend/src/app/oauth/callback/page.tsx
+++ b/frontend/src/app/oauth/callback/page.tsx
@@ -12,7 +12,7 @@ function OAuthCallbackContent() {
useEffect(() => {
const token = searchParams.get('token')
- const redirect = searchParams.get('redirect') || '/dashboard'
+ const redirect = searchParams.get('redirect') || '/command/dashboard'
const isNew = searchParams.get('new') === 'true'
const error = searchParams.get('error')
diff --git a/frontend/src/app/page.tsx b/frontend/src/app/page.tsx
index a1f5ab6..1876447 100644
--- a/frontend/src/app/page.tsx
+++ b/frontend/src/app/page.tsx
@@ -768,7 +768,7 @@ export default function HomePage() {