Discourse redirects to the OAuth server after loading `/?authComplete=true`

I’m not sure exactly what’s going on. @ryancey if you are able to share a link to the site I’d be happy to take a quick look.

Some of the logic around redirection is in

We use the omniauth origin system, which uses the referrer to determine the user’s starting location: Saving User Location · omniauth/omniauth Wiki · GitHub.

That can be overridden by the destination_url cookie, or the origin= URL parameter. You could try using https://[discourse-server]/auth/oauth2_basic?origin=/, to ensure that your users always end up on the forum homepage.

I know @LeoMcA recently made some improvements here, so make sure you’re running a recent version of Discourse.