My company is starting to offer access to our discourse as part of our main product, and we decided to build a custom OAuth integration so people can login with the existing account.

We created as an authenticator based on FB and Twitter ones from Discourse codebase, released that as an internal Discourse plugin, and turned our main app into an OAuth provider. So far so good and everything worked just fine in development, but unfortunately I’m getting a PG constraint error in production.