We have an issue when users click on a piece of protected content (like a shared link in Twitter) and they are not logged in. The go to our memberful login page (SSO) and come back to the root categories, not the original item they clicked on. This seems like it should be built in somehow. Memberful suggested I reach out to the community:
On the SSO side of things we don’t know the page the user was originally trying to access that was protected, in the case of Discourse we redirect to the " /session/sso_login " endpoint after a successful login. Discourse then checks the value of the destination cookie (discourse/login.js.es6 at master · discourse/discourse · GitHub) it stored to determine where to send the user, and in this case the cookie on your installation of Discourse is either being unset or set to “Intelligent Fanatics” as that was the page where the SSO login was triggered from.
None of the settings you suggested seem to solve this issue, it looks like a code change will be required in Discourse to set the destination cookie differently if you are redirected to another page before the SSO is called. If this feature is essential it might be worth contacting the Discourse team on their development discussion.
Any help, much appreciated! Maybe it’s a simple setting somewhere I’m missing.