mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 16:51:38 +10:00
wip: refresh design
This commit is contained in:
25
apps/web/src/middleware.ts
Normal file
25
apps/web/src/middleware.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
export default async function middleware(req: NextRequest) {
|
||||
if (req.nextUrl.pathname === '/') {
|
||||
const redirectUrl = new URL('/dashboard', req.url);
|
||||
|
||||
return NextResponse.redirect(redirectUrl);
|
||||
}
|
||||
|
||||
// if (req.nextUrl.pathname.startsWith('/dashboard')) {
|
||||
// const token = await getToken({ req });
|
||||
|
||||
// console.log('token', token);
|
||||
|
||||
// if (!token) {
|
||||
// console.log('has no token', req.url);
|
||||
// const redirectUrl = new URL('/signin', req.url);
|
||||
// redirectUrl.searchParams.set('callbackUrl', req.url);
|
||||
|
||||
// return NextResponse.redirect(redirectUrl);
|
||||
// }
|
||||
// }
|
||||
|
||||
return NextResponse.next();
|
||||
}
|
||||
Reference in New Issue
Block a user