Speaking of security, we created a registry for building OIDC configuration components.
Pick your providers, form and validation libraries, and token verifier (powered by jose). Then run one command to copy everything into your app.
I've built these a few times before. I know how annoying they can be to get right. Hope this helps.