Custom Social provider Cannot read properties of undefined (reading 'tenant')

Im trying to implement a custom social provider. I have most of it working except when application redirects to my callback url after going through my social providers /authorize endpoint I’m receiving “Cannot read properties of undefined (reading ‘tenant’)” as an error on my application page.

I’ve looked at everything and can’t see anything pointing to where or what tenant needs to be set and where.

I think my issue was I wasn’t returning code from my /authorization endpoint in my social provider