Lumen & Gesso / website · lumengesso.com / app / auth / confirm / route.ts
| 1 | import { NextResponse } from 'next/server'; |
| 2 | import { authOrigin } from '@/app/lib/lumen-auth'; |
| 3 | import { safeNext } from '@/app/lib/safe-next'; |
| 4 | |
| 5 | export const dynamic = 'force-dynamic'; |
| 6 | |
| 7 | export function GET(request: Request) { |
| 8 | const next = safeNext(new URL(request.url).searchParams.get('next')); |
| 9 | const login = new URL('/login', authOrigin()); |
| 10 | login.searchParams.set('next', next); |
| 11 | login.searchParams.set('error', 'link_expired'); |
| 12 | return NextResponse.redirect(login); |
| 13 | } |