best way to redirect based on user on / route
Answered
Minskin posted this in #help-forum
MinskinOP
Hey, i would like to change the rendered site when the user is logged in on the / route, what is the best practice to do this? Because then / should redirect to the dashboard, with a new layout etc.
5 Replies
Answer
export function middleware(request: NextRequest) {
return NextResponse.redirect(new URL('/home', request.url))
}MinskinOP
Thanks, will look into it
@Minskin Thanks, will look into it
np, if it helped make sure to tag my answer as solution