MCPcopy Create free account
hub / github.com/Gan-Xing/CodexBridge / redirectTo

Function redirectTo

apps/web/proxy.ts:4–8  ·  view source on GitHub ↗
(request: NextRequest, pathname: string, status = 307, search = '')

Source from the content-addressed store, hash-verified

2import { getWebAuthConfig, isAuthenticatedCookie } from '@/lib/server/auth';
3
4function redirectTo(request: NextRequest, pathname: string, status = 307, search = '') {
5 const normalizedPath = pathname.startsWith('/') ? pathname : `/${pathname}`;
6 const location = new URL(`${normalizedPath}${search}`, request.url);
7 return NextResponse.redirect(location, status);
8}
9
10function isPublicPath(pathname: string) {
11 return pathname === '/login'

Callers 1

proxyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected