Sign in with Google not working


(Arpit Jalan) #1

I just spunned off a new Discourse instance on Digital Ocean droplet, and tried to sign up with my google account. The account got verified with google successfully, but Create Now button remains disabled. I tried changing Name and Username manually, but it remains disabled for me.

[Extra info if it helps: I spunned two Digital Ocean droplets consecutively, both time I got the same server IP address, on first droplet when I tried signing in with google it worked successfully, but on second droplet it didn’t work. The console didn’t show any error.]


(Arpit Jalan) #2

Ok, I just tried sigining up with another google account, and it worked successfully. It seems like it’s an edge case problem, something related to admin account email activation.


(Neil Lalonde) #3

That bug has been reported before, but I’ve never seen it happen… Since there’s no error, it’s hard to track down. Seems like a problem in the javascript, but that’s a wild guess.


(Jeff Atwood) #4

@neil I don’t think we should be disabling the button here, I think we should pop up an alert if they click and something is wrong. Login is too important to have people blocked by minor JS errors resulting in a disabled button…

plus if the check is performed at button press time, there’s a bit more time for the server to respond with name checks, email checks, etc.


(JP Gordon) #5

We had the same issue today with one customer:

Hope the fix is quick…


(Kevin Reese) #6

There may be other edge cases,
but our main issue appears to be caused by the “tos accept required” setting.

I tracked it down to Submit Button disabled attribute binds to this submitDisabled function:

which was always disabled because in the Admin panel tos accept required was true:
domain.com/admin/site_settings/category/legal

however, we monkey patched our Create Account view via plugin:
git_repo/plugins/custom_login_logout/assets/javascripts/discourse/templates/modal/create_account.js.handlebars

and that template added Terms of Service required checkbox (2 months ago):
https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/templates/modal/create_account.js.handlebars#L69-L74

Solution:

  • toggle-off “tos accept required” option in Admin > Site Settings > Legal
  • add the missing tos checkbox HTML to our plugin’s handlebars template
  • manage “tos accept required” on or off

The strange thing, on the other hand, the bug was not persistent.
Many users successfully created accounts during the last two months…
so, under certain circumstances the button may have been both active and disabled at the same time… because Schrödinger?


(Neil Lalonde) #7

The signup with 3rd party problem with the disabled button shouldn’t happen anymore. I fixed it so the button will never be disabled in that case. The server will return errors if anything is wrong in the form.

@reese That’s a bigger problem… When we change our templates, plugins that are overwriting the templates might need to be updated. It’s strange that people were able to signup at all on your site after we added tosAcceptRequired.


(Kevin Reese) #8

Thanks @neil.

It turns out that we were also overriding the CreateAccountController.submitDisabled function from our plugin until just a couple days ago. Which explains why the tos change suddenly affected our app.

We are guessing the handful of successful new accounts during that window were the result of savvy users knowing how to $('button[disabled]').removeAttr('disabled')


(Jeff Atwood) #9