It's simple:
if (signUpSuccessful(request, response)) { response.statusCode = 302; response.setHeader("Location", "/login"); response.end(); }
This will redirect the user to the URL /login with the status 302 Found and complete the response. Make sure you have not called response.write() yet, otherwise an exception will be thrown.
gustavohenke
source share