Hey, we had a use case where we need to integrate discourse in current product (Next js app). We are looking to build a community using discourse APIs. We are facing an issue with the login flow.
More context: The product’s webapp uses google login let’s say example.com. Discourse forum is self hosted on discourse.example.com. As its a single page application we would like to have dynamic authentication to discourse, based on the exploration we did, this is not possible. We looked at how discourseConnect works and have created a small prototype to understand the overall flow. The problem with discourse connect is that, it redirects to discourse.example.com.
Question is: How would we login a user in discourse to call authenticated APIs from our SPA?