Fixes issue where Login redirect_uri is built incorrectly for apps fronted by Imperva due to the app's use of req.get('host') in determining the current domain. The fix is:
Enable Express "trust proxy" setting, instructing it to accept the forwarded host and proto for traffic from "loopback" (matching 127.0.* traffic?)
Update the code that generates the redirect_uri to use req.hostname instead of req.get('host') to ensure we use the forwarded hostname instead of the literal header.
Fixes issue where Login redirect_uri is built incorrectly for apps fronted by Imperva due to the app's use of
req.get('host')
in determining the current domain. The fix is:req.hostname
instead ofreq.get('host')
to ensure we use the forwarded hostname instead of the literal header.