Redirect to Discourse page after logging in to Wordpress as SSO Provider (via WooCommerce)

AI-generated summary

jord8on is seeking help with redirecting users to the Discourse page after logging in to Wordpress as the SSO Provider via WooCommerce. Currently, when a user logs in to Wordpress, they are redirected to the Wordpress /my-account page, but when attempting to log in from Discourse, they are not redirected back to Discourse. The user has tried various solutions and is looking for a custom code to resolve the issue. knandi has asked if a solution has been found, while pfaffman has suggested that custom code is usually required for WooCommerce integration and recommended exploring the subscriptions plugin.

Continuing a discussion with @simon from: Get Discourse to recognize accounts verified in Wordpress (and WooCommerce) for SSO:

Here’s some info about our setup:

  • We are using the WP Discourse plugin for my Wordpress site
  • We are using Wordpress as the SSO Provider
  • We DO NOT use the default wp-login.php for users to login or register
  • We DO NOT use a dedicated membership plugin, like Memberful
  • We DO use WooCommerce as our login provider, which also manages users and provisions new users in Wordpress, after new accounts are created
  • WooCommerce uses /my-account for Registration/Login (e.g. https://pickleballist.com/my-account)
  • Using the tip provided in the link above - when a Verified WP User, who is logged in to WP, clicks the “Login” button on Discourse, they are automatically logged in to Discourse :+1:

The challenge we are facing is that users are never redirected to Discourse. Here’s what we’d like to see:

User is on Wordpress: If a user clicks Register/Login, we would want them to see the WP login/reg modal, use it, and after logging in, be redirected to the Wordpress /my-account page. This is what currently is happening.

User is on Discourse: If a user clicks the “Login” or a “Reply” button on one of the threads, we would want them to see the WP login/reg modal, use it, and after logging in, be redirected back to the place where they left Discourse.

I’ve reviewed some other threads but can’t seem to find a solution that works for us. Any help would be greatly appreciated!

Have you found a solution? I would be glad

If you want to charge for access to discourse, I’d recommend the new subscriptions plugin.

There see other topics about getting woocommerce. It usually requires some custom code.