Not able to login into forums with Discord

I am having an issue signing into our forum (forums.thecookout.org) after signing out.

After authenticating through Discord, I’m being sent to the following URL:

https://forums.thecookout.org/auth/failure?message=csrf_detected&strategy=discord

and getting the following error:

Authorization timed out, or you have switched browsers. Please try again.

I’m not entirely sure what’s going on and could use any help.

Thanks in advance!

1 Like

FYI for others seeing this.

I have never been your site, but I also get

Not that I can help, but it may help others looking to help you.

2 Likes

Please update to latest, we recently changed the code around that.

4 Likes

How can I change it from cmd/Docker?

I am unable to get to the GUI.

1 Like

SSH into the server

cd /var/discourse
./launcher rebuild app
2 Likes

I have attempted that twice and am still receiving the error.

To further add to what I’m seeing, when I log into the Docker image and view the logs

/var/www/discourse/log/production.log

The error I’m seeing is:

(discord) Authentication failure! csrf_detected: OmniAuth::Strategies::OAuth2::CallbackError, 
csrf_detected | CSRF detected
Started GET "/auth/failure?message=csrf_detected&strategy=discord" for 99.14.146.128 at 2019-09-11 21:19:27 +0000
Processing by Users::OmniauthCallbacksController#failure as HTML
Parameters: {"message"=>"csrf_detected", "strategy"=>"discord"}
Rendering users/omniauth_callbacks/failure.html.erb within layouts/no_ember
Rendered users/omniauth_callbacks/failure.html.erb within layouts/no_ember (0.1ms)
Rendered layouts/_head.html.erb (16.0ms)
Rendered common/_discourse_stylesheet.html.erb (0.4ms)
Rendered application/_header.html.erb (0.3ms)
Completed 200 OK in 21ms (Views: 17.8ms | ActiveRecord: 0.0ms)
1 Like

Apparently, the issue was stemming from using GitHub - featheredtoast/discourse-plugin-discord-auth: A Discourse plugin to login over Discord for Discord authentication instead of the built-in method.

Not sure when it was added, but using it now and everything is working smoothly!

Thank you all for your assistance!

6 Likes

Oh, that’d do it. My branch was the original repo for the plugin, and hasn’t been updated to allow for core’s plugin, like the repo under discourse was.

I’ll update that to mirror discourse’s repo as well. Sorry for the trouble, and well sleuthed!

4 Likes

No problem!

It was serving me well!

Thank you for leading the charge!

2 Likes

Hi, maybe this isn’t the right topic (don’t know if I should open a different one) but I’m experiencing this issue with the LDAP Auth plugin. Can it be related?