FEAT(jotion): redirect root path to /home
- Add redirect from / to /home in middleware - Remove / from publicPaths list
This commit is contained in:
@@ -4,9 +4,14 @@ import { verifyToken } from './src/shared/lib/auth'
|
|||||||
export function middleware(request: NextRequest) {
|
export function middleware(request: NextRequest) {
|
||||||
const { pathname } = request.nextUrl
|
const { pathname } = request.nextUrl
|
||||||
|
|
||||||
|
// Redirect root path to /home
|
||||||
|
if (pathname === '/') {
|
||||||
|
const url = new URL('/home', request.url)
|
||||||
|
return NextResponse.redirect(url)
|
||||||
|
}
|
||||||
|
|
||||||
// Public paths that don't require authentication
|
// Public paths that don't require authentication
|
||||||
const publicPaths = [
|
const publicPaths = [
|
||||||
'/',
|
|
||||||
'/home',
|
'/home',
|
||||||
'/home/signIn',
|
'/home/signIn',
|
||||||
'/home/signUp',
|
'/home/signUp',
|
||||||
|
|||||||
Reference in New Issue
Block a user