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

Using popup mode from local file causes misleading error #137

Closed
nicosabena opened this issue Mar 27, 2016 · 0 comments
Closed

Using popup mode from local file causes misleading error #137

nicosabena opened this issue Mar 27, 2016 · 0 comments

Comments

@nicosabena
Copy link
Contributor

When trying to use popup mode from a local html file (file:///.../sample.html), authentication appears to work correctly, but the popup window remains open, with message "Login was successful Please close this tab to continue".

When closing the popup, a server error is reported by the callback, originated from https://github.com/auth0/auth0.js/blob/master/lib/LoginError.js#L31. When debugging, this is actually called from the popup window (xxx.auth0.com/login/callback) with the message "User closed the popup window".
So, first problem is that we get a "Server error" when the error is cause by "User closed the popup window". But there is another problem before: the automatic window closing fails, reporting an invalid origin (null value) with stack trace:

Uncaught SyntaxError: Failed to execute 'postMessage' on 'Window': Invalid target origin 'null' in a call to 'postMessage'.
doPost @ callback?state=Q9IE2CiZcZxavVqD&code=4/8rmDyM5lhQ17h2BW1QKoB6UHVmHXAZbI39hPwTNp3PU:394
(anonymous function) @ callback?state=Q9IE2CiZcZxavVqD&code=4/8rmDyM5lhQ17h2BW1QKoB6UHVmHXAZbI39hPwTNp3PU:416
resolve @ callback?state=Q9IE2CiZcZxavVqD&code=4/8rmDyM5lhQ17h2BW1QKoB6UHVmHXAZbI39hPwTNp3PU:117
(anonymous function) @ callback:521(anonymous function) @ callback?state=Q9IE2CiZcZxavVqD&code=4/8rmDyM5lhQ17h2BW1QKoB6UHVmHXAZbI39hPwTNp3PU:414

This is all probably cause by an invalid origin (the local file, file:///) but since is not properly handled the errors are very misleadings. When the file is served from a http server, there is a message correctly indicating an incorrect origin.

@nicosabena nicosabena changed the title Using popup mode from local file cause misleading error Using popup mode from local file causes misleading error Mar 27, 2016
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

No branches or pull requests

3 participants