Users are saved to MongoDB, but fails to redirect and I get an error after

express
nodejs
mongodb

#1

Hi there,

I am doing the web dev bootcamp project, and ran across a problem with authentication.

Basically, my users are being saved to Mongo (I can go into mongo and check manually) but when I do a res.redirect to a page, it hangs for a couple minutes until giving me a 502 bad gateway error.

Here’s my basic authentication code (see JS) and the error page I see (as raw html - in the HTML window): https://jsfiddle.net/shontc9p/

I’ve seen a bunch of other posts but none of them really worked.

Thanks!