feat: Secure API routes with authentication checks and enhance redirect handling for unauthenticated users.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user