Skip to content
New issue

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

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

Already on GitHub? # to your account

Popup is closed #86

Open
ptbrowne opened this issue May 10, 2016 · 2 comments
Open

Popup is closed #86

ptbrowne opened this issue May 10, 2016 · 2 comments

Comments

@ptbrowne
Copy link

Hi,

Since recently, I have a problem with OAuthJS with the popup method. I use the last version of OAuthJS from master.

On my site (https://gethupp.com), with Chrome Canary (52.0), I get the "Error: The popup was closed", on my oauthd server, I have the same error.

However on Chrome (50.0), on my site I have the same error but on the oauthd server I do not have it.

I have no idea how to debug that. Do you have any lead ?

Thanks !

@JonKrone
Copy link

JonKrone commented Jul 1, 2016

Hey Ptbrowne!

I was struggling with this same issue for a couple of hours but was able to get something working.

Tracing the problem from the error message in the OAuth library, I noticed that the error does not necessarily result from some invalid response from the OAuth protocol but was based on whether we had received a message by the time the window was closed or dereferenced. I wasn't too confident in this checking because networking is never an orderly process and browsers can sometimes change event orderings. By tinkering with the interval rate of the closed window check, I was able to tell that we were receiving the correct information from our service and that the OAuth package was prematurely hanging up on the connection.

Would someone familiar (@bumpmann) with the library tell us if this is expected behavior or provide some insight as to the design? If this is a flaw, I'm happy to spend some time to try to find and implement a solution.

Thanks!

@bumpmann
Copy link
Contributor

bumpmann commented Sep 29, 2016

This is the expected behavior only when the popup is closed without having received the response (allow, deny, an error etc.). I guess the real cause is because it can't receive the message on time or something blocked it but i think that chrome is sending immediately (~event queue) the window message and don't need a delay, that would be to check.

If you don't see the popup or on a very short time, it may also be that you are using an extension (not sure what would cause that) or that you misplaced the popup invocation that must be in a direct user action (click...). You can replace the popup() with window.open('http://google.com', '_blank') if you're not sure.

Any news since chrome is 53?

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

No branches or pull requests

3 participants