chore(strip): verwijder /epd/clients redirect-laag
Alle verwijzingen (middleware, login, auth-callback, set-password, Cortex context-bar) wijzen nu rechtstreeks naar /epd/patients; de backwards-compat redirects zijn daarmee overbodig. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -110,7 +110,7 @@ export async function GET(request: NextRequest) {
|
|||||||
return NextResponse.redirect(new URL('/set-password', request.url))
|
return NextResponse.redirect(new URL('/set-password', request.url))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Redirect to the specified next URL or default to /epd/clients
|
// Redirect to the specified next URL or default to /epd/patients
|
||||||
// This includes: password signups, confirmed email users, and returning users
|
// This includes: password signups, confirmed email users, and returning users
|
||||||
return NextResponse.redirect(new URL(next, request.url))
|
return NextResponse.redirect(new URL(next, request.url))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
import { redirect } from 'next/navigation';
|
|
||||||
import { NextRequest } from 'next/server';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Catch-all Redirect Route for /epd/clients/
|
|
||||||
*
|
|
||||||
* Redirects all /epd/clients/* routes to /epd/patients/* for backward compatibility
|
|
||||||
* This ensures that old bookmarks and links continue to work after migration.
|
|
||||||
*
|
|
||||||
* Preserves query parameters (e.g., ?tab=intake&search=test)
|
|
||||||
*/
|
|
||||||
|
|
||||||
export async function GET(
|
|
||||||
request: NextRequest,
|
|
||||||
{ params }: { params: Promise<{ path: string[] }> }
|
|
||||||
) {
|
|
||||||
const { path } = await params;
|
|
||||||
const searchParams = request.nextUrl.searchParams;
|
|
||||||
|
|
||||||
// Build new path with query parameters
|
|
||||||
const newPath = `/epd/patients/${path.join('/')}`;
|
|
||||||
const newUrl = new URL(newPath, request.url);
|
|
||||||
|
|
||||||
// Preserve all query parameters
|
|
||||||
searchParams.forEach((value, key) => {
|
|
||||||
newUrl.searchParams.set(key, value);
|
|
||||||
});
|
|
||||||
|
|
||||||
redirect(newUrl.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
import { redirect } from 'next/navigation';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Clients Root Redirect
|
|
||||||
* Redirects /epd/clients to /epd/patients for backward compatibility
|
|
||||||
*/
|
|
||||||
|
|
||||||
export default function ClientsRedirect() {
|
|
||||||
redirect('/epd/patients');
|
|
||||||
}
|
|
||||||
@@ -20,7 +20,7 @@ export function LoginForm() {
|
|||||||
|
|
||||||
// Redirect path based on interface preference
|
// Redirect path based on interface preference
|
||||||
const getRedirectPath = () => {
|
const getRedirectPath = () => {
|
||||||
return interfacePreference === 'cortex' ? '/epd/cortex' : '/epd/clients'
|
return interfacePreference === 'cortex' ? '/epd/cortex' : '/epd/patients'
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSubmit = async (e: React.FormEvent) => {
|
const handleSubmit = async (e: React.FormEvent) => {
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export default function SetPasswordPage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleSkip() {
|
function handleSkip() {
|
||||||
router.push('/epd/clients')
|
router.push('/epd/patients')
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export function ContextBar() {
|
|||||||
{/* Left: Logo + Shift */}
|
{/* Left: Logo + Shift */}
|
||||||
<div className="flex items-center gap-4">
|
<div className="flex items-center gap-4">
|
||||||
<Link
|
<Link
|
||||||
href="/epd/clients"
|
href="/epd/patients"
|
||||||
className="flex items-center gap-2 text-slate-600 hover:text-slate-900 transition-colors"
|
className="flex items-center gap-2 text-slate-600 hover:text-slate-900 transition-colors"
|
||||||
title="Terug naar EPD"
|
title="Terug naar EPD"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ export async function middleware(request: NextRequest) {
|
|||||||
// Helper: get preferred interface redirect path
|
// Helper: get preferred interface redirect path
|
||||||
const getPreferredPath = () => {
|
const getPreferredPath = () => {
|
||||||
const preference = user?.user_metadata?.preferred_interface
|
const preference = user?.user_metadata?.preferred_interface
|
||||||
return preference === 'cortex' ? '/epd/cortex' : '/epd/clients'
|
return preference === 'cortex' ? '/epd/cortex' : '/epd/patients'
|
||||||
}
|
}
|
||||||
|
|
||||||
// Redirect to preferred interface if authenticated and trying to access login
|
// Redirect to preferred interface if authenticated and trying to access login
|
||||||
|
|||||||
Reference in New Issue
Block a user