All Articles

Passport errors with Blitz!

When using a reverse-proxy with nginx and blitz, you may be getting some obscure errors in your passportjs handlers.

In my case, I was using Dokku to manage TLS in production, and getting obscure failure messages:

Error: Your 'azuread-openidconnect' passport verify callback returned empty data. Ensure you call 'done(null, {publicData: {userId: 1}})' along with any other publicData fields you need)

The solution is to add secureProxy: true to your passportjs strategy. This was because the x-forwarded-proto wasn’t being set properly.

This took me a while to figure out, so I hope the links below help!

Issue is solved here:

Commit fix is here:

Documentation on it is here: