mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
return notFound instead of sending to overview page
This commit is contained in:
parent
230849744d
commit
50c4b592a4
@ -1,5 +1,5 @@
|
||||
import { source } from 'lib/source';
|
||||
import { redirect } from 'next/navigation';
|
||||
import { notFound, redirect } from 'next/navigation';
|
||||
import { NextRequest } from 'next/server';
|
||||
|
||||
export function GET(request: NextRequest) {
|
||||
@ -25,7 +25,7 @@ export function GET(request: NextRequest) {
|
||||
// Page exists, redirect to the full path
|
||||
return redirect(targetPath);
|
||||
} else {
|
||||
// Page doesn't exist, redirect to overview
|
||||
return redirect('/docs/js/overview');
|
||||
// Page doesn't exist, return 404
|
||||
return notFound();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { source } from 'lib/source';
|
||||
import { redirect } from 'next/navigation';
|
||||
import { notFound, redirect } from 'next/navigation';
|
||||
import { NextRequest } from 'next/server';
|
||||
|
||||
export function GET(request: NextRequest) {
|
||||
@ -26,6 +26,6 @@ export function GET(request: NextRequest) {
|
||||
return redirect(targetPath);
|
||||
} else {
|
||||
// Page doesn't exist, redirect to overview
|
||||
return redirect('/docs/next/overview');
|
||||
return notFound();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { source } from 'lib/source';
|
||||
import { redirect } from 'next/navigation';
|
||||
import { notFound, redirect } from 'next/navigation';
|
||||
import { NextRequest } from 'next/server';
|
||||
|
||||
export function GET(request: NextRequest) {
|
||||
@ -26,6 +26,6 @@ export function GET(request: NextRequest) {
|
||||
return redirect(targetPath);
|
||||
} else {
|
||||
// Page doesn't exist, redirect to overview
|
||||
return redirect('/docs/python/overview');
|
||||
return notFound();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { source } from 'lib/source';
|
||||
import { redirect } from 'next/navigation';
|
||||
import { notFound, redirect } from 'next/navigation';
|
||||
import { NextRequest } from 'next/server';
|
||||
|
||||
export function GET(request: NextRequest) {
|
||||
@ -26,6 +26,6 @@ export function GET(request: NextRequest) {
|
||||
return redirect(targetPath);
|
||||
} else {
|
||||
// Page doesn't exist, redirect to overview
|
||||
return redirect('/docs/react/overview');
|
||||
return notFound();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { apiSource } from 'lib/source';
|
||||
import { redirect } from 'next/navigation';
|
||||
import { notFound, redirect } from 'next/navigation';
|
||||
import { NextRequest } from 'next/server';
|
||||
|
||||
export function GET(request: NextRequest) {
|
||||
@ -26,6 +26,6 @@ export function GET(request: NextRequest) {
|
||||
return redirect(targetPath);
|
||||
} else {
|
||||
// Page doesn't exist, redirect to overview
|
||||
return redirect('/api/overview');
|
||||
return notFound();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user