Middleware How to use Redirect to go back to the root page or http://localhost:3000/
Answered
Ejayz || PiggyDev posted this in #help-forum
So i am using the middleware but the NextResponse.redirect() do not allow to add a
/ as parameter and requires a valid URL how do i redirect based on path like /dashboard or /login . Thank you3 Replies
@Ejayz || PiggyDev So i am using the middleware but the NextResponse.redirect() do not allow to add a / as parameter and requires a valid URL how do i redirect based on path like /dashboard or /login . Thank you
NextResponse.redirect(new URL('/login', request.url))Answer
ohhhhhhh
yea did noty give error message