The user is attempting to integrate OAuth login functionality between a Flask app and a Discourse instance. They have two scenarios:
User signs up for a Discourse account via OAuth and wants to be redirected back to the Flask app’s /home page after completing registration.
User signs in to the Flask app using their existing Discourse account via OAuth and wants to be redirected to the /user page after verification.
nix is seeking an optional callback_url parameter that would allow Discourse to redirect the user to the specified URL after OAuth verification. This would enable the Discourse instance to act as an OAuth provider for the Flask app. rishabh suggested checking the Discourse documentation, but nix found that it does not cover their specific use case.
Unfortunately as far as I can tell the documentation doesn’t cover my questions. My OAuth configurations are working as expected, it’s only the additional functionality outlined in scenarios 1 & 2 that cause trouble.
What I’m looking for is something along the lines of an optional parameter, callback_url, that would redirect the user to its target URL, after the OAuth provider has verified their account, and returned them to Discourse.
I guess it’s sort of as if my Discourse instance acted as an OAuth provider in and of itself, for my Flask/Python app?
E.g. https://discourse.example.com/auth/google?callback_url=https://example.com/home takes the user to Google, returns them to Discourse, which in turn redirects them to callback_url.