feat: Secure API routes with authentication checks and enhance redirect handling for unauthenticated users.

This commit is contained in:
2026-02-03 18:51:16 +00:00
parent 7c6d1cd681
commit be7db36126
9 changed files with 90 additions and 13 deletions

View File

@@ -46,6 +46,11 @@ export default function OnboardingPage() {
body: JSON.stringify({ url }),
})
if (response.redirected) {
router.push('/auth?next=/onboarding')
return
}
const data = await response.json()
if (!response.ok) {
@@ -108,6 +113,11 @@ export default function OnboardingPage() {
}),
})
if (response.redirected) {
router.push('/auth?next=/onboarding')
return
}
let finalAnalysis = manualAnalysis
if (response.ok) {