meteor-phonegap-oauth
meteor-phonegap-oauth copied to clipboard
Latest update breaks logins
The last update breaks the login popup. (on android at least). As soon as the content of the page is ready it closes.
It closes too early to enter any credentials, and nothing seems to happen after.
I think @jperl might have fixed this issue on this commit. I just released a new meteorite version, can you update it to 0.1.7 and see if that fixes it?
I could have sworn this all worked last week. I've updated to 0.1.7 but there's a new issue.
As soon as I login on Android, when the window closes nothing seems to happen,
On iOS the browser page seems to stay white. Upon inspection via safari I can see just one thing on the DOM tree:
<script type="text/javascript">
if (true) {
var credentialToken = "<hidden>";
var credentialSecret = "<hidden>";
if (window.opener && window.opener.Package &&
window.opener.Package.oauth) {
window.opener.Package.oauth.OAuth._handleCredentialSecret(
credentialToken, credentialSecret);
} else {
try {
localStorage["Meteor.oauth." + credentialToken] = credentialSecret;
} catch (err) {
// We can't do much else, but at least close the popup instead
// of having it hang around on a blank page.
}
}
}
window.close();
</script>
This page stays open but nothing happens.
One thing that may matter: I'm using Meteor 0.9.0 rc5, Looking at the code above I also checked out window.opener
, which is null
if that means anything?
I do not think the package is loading, otherwise you would see this code as the response instead https://github.com/AdamBrodzinski/meteor-phonegap-oauth/blob/master/patch_login_response.js#L17-L28
.
0.9.0
is the packaging release, we probably need to upgrade this package's package.js
to the new format.
That makes sense, I had developed the front end using 0.9.0-rc5 and forgot that the back end may be different.
So I've updated it now and Android works perfectly.
Its just iOS, with the same white screen problem.
This time the js is this:
<script type="text/javascript">
var credentialToken = "<something>",
credentialSecret = "<something>";
window.location.hash = "credentialToken=" + credentialToken + "&credentialSecret=" + credentialSecret;
try { localStorage["Meteor.oauth."+ credentialToken] = credentialSecret; } catch (err) { }try { window.opener && window.opener.Package.oauth.OAuth._handleCredentialSecret( credentialToken, credentialSecret); } catch (err) { }window.close();</script>
Again window.opener
is null
which is probably why the rest isn't uploading.
Also regarding 0.9.0-rc5 the transitio with this package is relatively easy. I think the latest 0.1.7 hasn't been put up on the new atmosphere server, I've just included it in /packages manually. Meteor accepts the old package.js files without any trouble.
It seems like meteor is fixing the oauth flow for cordova so we may not need this package soon.
@jperl Nice!