Window.open called twice for oauth login


(Fred Kelly) #1

Hola,

We’ve noticed since upgrading to v1.0.2 that when a user clicks sign in two new ‘externalLogin’ dialogs are opened on top of another.

It seems that this is being caused by this change: FIX: dispatch correct modal on auto login · discourse/discourse@e16dd96 · GitHub

Specifically it seems lines 51-53 are triggering two windows (perhaps because both autoLogin (which contains calls to showModal) and showModal itself are called?).

I’m assuming this is probably a nuance relating to our particular configuration, rather than a general bug. Does anyone know what might be happening here?

Much appreciated! :slight_smile:


(Sam Saffron) #2

Can you expand on your particular config, and perhaps give me a repro?


(Fred Kelly) #3

Hi Sam,

We are using our own custom auth provider (subclass of OmniAuth::Strategies::OAuth2) with local logins disabled (this is the only overridden login setting).

Are there any specific configuration values that would help you diagnose?

Thanks


(Sam Saffron) #4

Can this be reproduced with any other strategy ? Perhaps only enable GitHub etc? Do you have a local dev setup?


(Fred Kelly) #5

I will try using Github and see if the same happens.

Yes I am running locally; you can see the error in production at http://community.bitnami.com/


(Fred Kelly) #6

Turns out this was a patch we’d added in the past calling autoLogin() a second time :blush: – thanks for your help.


(Jeff Atwood) #7