Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoiding initialize the sidebar when user is logged out #249

Merged
merged 1 commit into from
Feb 15, 2018

Conversation

danielvlopes
Copy link
Contributor

The Chat is currently breaking the OAuth flow for at least Google (but potentially all other providers too). The sidebar component does not check for the current user and makes ajax calls to the Rails backend that get interrupted with access denied and subsequently stored as a destination_url cookie that Discourse uses to setup the OAuth flow.

The steps to reproduce the bug are:

  1. Enable OAuth with Google
  2. Start an incognito session and make sure there’s only Babble installed and no other plugins
  3. Login normally (not using Google)
  4. Log out
  5. Inspect the cookies and look for the destination_url, it should have an URL with topics.json there
  6. Now login with Google OAuth
  7. During the confirmation page inspect the output of this line: https://github.com/discourse/discourse/blob/master/app/views/users/omniauth_callbacks/complete.html.erb#L28
  8. Now complete the flow, and you should be redirected to the topics.json page instead of the regular HTML.

Video with the steps to reproduce here:
https://meta.discourse.org/t/babble-a-chat-plugin/31753/811?u=daniel_lopes

I'm running this fix in Production and it's working fine for me.

@gdpelican gdpelican merged commit 76feb9b into gdpelican:master Feb 15, 2018
@gdpelican
Copy link
Owner

Thanks for the great detective work @danielvlopes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants