Mobile Firefox / in-app Safari social login flow: "Close this window to continue"

(Chris Beach) #1

UPDATE: this issue also affects!

In-app Safari and Firefox presents the following annoying message when trying to use social login (same for Facebook and Google login). Stops in-app login working, as the user is unable to close a single tab (unlike in Firefox):

My site is hosted on and I have configured “valid OAuth redirect URLs” on to refer to both and

Could relate to this issue with http/https maybe.

Safari and Chrome apps seem unaffected.

Any suggestions?

UPDATE: this issue also affects!

(Jeff Atwood) #2

I will see if I can repro.

(Jeff Atwood) #3

Nope no repro. I logged in using Google here on iOS and did not see that page. Are you using stock browsers or are you changing settings or using plugins? Try doing this in safe mode with all browser plugins and browser customizations disabled.

Also note we don’t really support anything except the default browser on each mobile platform.

(Chris Beach) #4

I’m using stock Firefox app (no plugins) on iOS

And can also reproduce using the in-app browser from within Twitter on iOS (click on a tweet linking to forum and try logging into forum).

Users of my forum frequently discover it via a link in a tweet so this is a really big deal for my Discourse instance :frowning:

(Jeff Atwood) #5

From within Twitter, this might be a repro let me update the title.

I know @eviltrout worked on this for the in app Facebook browser.

(Robin Ward) #6

This commit applies the Facebook approach more aggressively. If there’s no window.opener then then login flow will use the localStorage method. I think it should work, but I don’t have a repro right now.

@ChrisBeach could you try again here on meta and let me know if this solution helps?

(Chris Beach) #7

Hi @eviltrout. I’ve just tried logging out and in again in Firefox on iOS. Same problem :frowning:

Screenshot shows Google login - same problem remains in Facebook login too

(Chris Beach) #8

Just tried Facebook login via in-app browser in Twitter on It logged in but seemed to get trapped in some kind of odd redirect loop - progress bar kept cycling endlessly and site not responding well.

(Rafael dos Santos Silva) #9

You forum is on a old version, the fix was deployed today.

Try the login flow here on

(Robin Ward) #10

How do you get twitter to point to meta? I’m trying to reproduce it for myself on my iPhone and can’t seem to figure it out.

edit: I figured out how to reproduce it. Working on it.

(Robin Ward) #11

Okay I think the latest fix works. I just logged in via the twitter browser using twitter. It has to redirect once but then it works!

(Chris Beach) #12

just tried logging in via Facebook in the in-app Twitter browser on iOS - working well now. Thanks very much!

If I were to upgrade my forum now, would it get the fix?

(Chris Beach) #13

by the way, whilst it works in the Twitter in-app browser, it’s still not working in Firefox on iOS - still get the “close this window to continue”

(Robin Ward) #14

It’s in the tests-passed branch of discourse right now, so if you are following that you will get it when you update. If you are on beta or stable you will have to wait for the change to trickle into them.

Regarding iOS Firefox: it’s an unsupported browser for us so if this fix doesn’t work I’m not sure we’ll get to it soon.